microsoft / microsoft/typespec
[hsjs] Implement support for discriminated unions.
Open
emitter:service:js
feature
triaged:core
- Dominant language
- Java
- Stars
- 5.9k
- Forks
- 394
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 104
Description
HSJS generally supports discriminated unions by construction as long as the structure of models allows TypeScript to discriminate between the variant types, but we don't have support yet for the discriminated union envelopes that were introduced recently. This issue tracks support for recognizing discriminated unions in the serializer and correctly building the envelope shape if required.
This issue should also consider whether additional care needs to be taken for inheritance-based discriminated unions.
Contributor guide
Assessment
This issue has not been assessed yet.