Skip to content

Discriminated unions seem broken for JS http client #7134

@billoneil

Description

@billoneil

https://typespec.io/docs/standard-library/discriminated-types/#inject-discriminator-inline

It appears like discriminated unions don't work with the newer form with generating the js http client. Possibly related to https://github.com/microsoft/typespec/pull/6286/files?

Image Image

Playground Link

This also causes issues.

@discriminated(#{envelope: "none"})
union Widget {
  heavy: WidgetBase,
  light: WidgetBase,
}
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    emitter:client:jsIssue for the JS client emitter: @typespec/http-client-js

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions