microsoft / microsoft/typespec

[hsjs] Implement support for discriminated unions.

Open
#7,277 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.