Skip to content

Discriminated union v2#6059

Merged
timotheeguerin merged 27 commits intomicrosoft:mainfrom
timotheeguerin:discriminated-union-v2
Feb 24, 2025
Merged

Discriminated union v2#6059
timotheeguerin merged 27 commits intomicrosoft:mainfrom
timotheeguerin:discriminated-union-v2

Conversation

@timotheeguerin
Copy link
Copy Markdown
Member

@timotheeguerin timotheeguerin commented Feb 19, 2025

fix #2738

@azure-sdk
Copy link
Copy Markdown
Collaborator

azure-sdk commented Feb 19, 2025

All changed packages have been documented.

  • @typespec/compiler
  • @typespec/emitter-framework
  • @typespec/http-specs
  • @typespec/openapi3
Show changes

@typespec/compiler - feature ✏️

Add new @discriminated decorator to represent discriminated union with implicit envelopes

@typespec/compiler - deprecation ✏️

Deprecate use of @discriminator on union. Migrate to @discriminated,> ,> diff lang="tsp",> -@discriminator("type"),> +@discriminated(#{envelope: "none", discriminatorPropertyName: "type"}),> union Pet;,>

@typespec/openapi3 - feature ✏️

Add support for new @discriminated unions

@typespec/http-specs - internal ✏️

@typespec/emitter-framework - internal ✏️

@azure-sdk
Copy link
Copy Markdown
Collaborator

azure-sdk commented Feb 20, 2025

You can try these changes here

🛝 Playground 🌐 Website 📚 Next docs 🛝 VSCode Extension

Copy link
Copy Markdown
Member

@chrisradek chrisradek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks great! Mostly doc comments and typos

Co-authored-by: Christopher Radek <14189820+chrisradek@users.noreply.github.com>
timotheeguerin and others added 4 commits February 20, 2025 14:41
Co-authored-by: Christopher Radek <14189820+chrisradek@users.noreply.github.com>
Co-authored-by: Christopher Radek <14189820+chrisradek@users.noreply.github.com>
@timotheeguerin timotheeguerin added this pull request to the merge queue Feb 24, 2025
@timotheeguerin timotheeguerin removed this pull request from the merge queue due to a manual request Feb 24, 2025
@timotheeguerin timotheeguerin added this pull request to the merge queue Feb 24, 2025
Merged via the queue into microsoft:main with commit f523b08 Feb 24, 2025
24 checks passed
@timotheeguerin timotheeguerin deleted the discriminated-union-v2 branch February 24, 2025 18:34
dmnorc pushed a commit to dmnorc/typespec that referenced this pull request Apr 9, 2025
fix microsoft#2738

---------

Co-authored-by: Christopher Radek <14189820+chrisradek@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Discuss implicit discriminator for named union

3 participants