-
Notifications
You must be signed in to change notification settings - Fork 351
Discriminated union v2 #6059
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
timotheeguerin
merged 27 commits into
microsoft:main
from
timotheeguerin:discriminated-union-v2
Feb 24, 2025
Merged
Discriminated union v2 #6059
Changes from 19 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
e5a57df
Discriminated union v2
timotheeguerin 8240234
.
timotheeguerin ae89d11
Add test in compiler
timotheeguerin 976d754
Discriminated union
timotheeguerin 4486fb1
discriminated union
timotheeguerin 453addf
Create discriminated-union-v2-2025-1-19-20-47-47.md
timotheeguerin eab7a52
Create discriminated-union-v2-2025-1-19-20-47-47-2.md
timotheeguerin 3a9bace
.
timotheeguerin e440ea1
fix
timotheeguerin df90564
Create discriminated-union-v2-2025-1-19-21-9-3.md
timotheeguerin 48c2ddd
tweaks
timotheeguerin c8a99f9
Merge branch 'discriminated-union-v2' of https://github.com/timotheeg…
timotheeguerin e6c7cda
Fix
timotheeguerin 8c9091a
handle variant for discriminated unions
timotheeguerin 0674c46
Create discriminated-union-v2-2025-1-20-20-20-31.md
timotheeguerin 049bec4
Merge branch 'main' into discriminated-union-v2
timotheeguerin 69d4e56
fix
timotheeguerin 685369f
fix
timotheeguerin 5daf6e7
.
timotheeguerin bcd1723
Update .chronus/changes/discriminated-union-v2-2025-1-19-21-9-3.md
timotheeguerin a61f375
Update packages/openapi3/src/schema-emitter-3-0.ts
timotheeguerin f02b45f
Update packages/openapi3/src/schema-emitter-3-1.ts
timotheeguerin b3e34a0
.
timotheeguerin f2cba79
.
timotheeguerin 8adaedd
Merge branch 'main' into discriminated-union-v2
timotheeguerin 5f7f667
update docs
timotheeguerin 92ae7fb
Merge branch 'main' into discriminated-union-v2
timotheeguerin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
.chronus/changes/discriminated-union-v2-2025-1-19-20-47-47-2.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| # Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking | ||
| changeKind: feature | ||
| packages: | ||
| - "@typespec/compiler" | ||
| --- | ||
|
|
||
| Add new `@discriminated` decorator to represent discriminated union with implicit envelopes |
14 changes: 14 additions & 0 deletions
14
.chronus/changes/discriminated-union-v2-2025-1-19-20-47-47.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| --- | ||
| # Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking | ||
| changeKind: deprecation | ||
| packages: | ||
| - "@typespec/compiler" | ||
| --- | ||
|
|
||
| Deprecate use of `@discriminator` on union. Migrate to `@discriminated` | ||
|
|
||
| ```diff lang="tsp" | ||
| -@discriminator("type") | ||
| +@discriminated(#{envelope: "none", discriminatorPropertyName: "type"}) | ||
| union Pet; | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| # Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking | ||
| changeKind: feature | ||
| packages: | ||
| - "@typespec/openapi3" | ||
| --- | ||
|
|
||
| Add support for new `@disriminated` unions | ||
6 changes: 6 additions & 0 deletions
6
.chronus/changes/discriminated-union-v2-2025-1-20-13-58-27.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| changeKind: internal | ||
| packages: | ||
| - "@typespec/http-specs" | ||
| --- | ||
|
|
6 changes: 6 additions & 0 deletions
6
.chronus/changes/discriminated-union-v2-2025-1-20-20-20-31.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| # Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking | ||
| changeKind: internal | ||
| packages: | ||
| - "@typespec/emitter-framework" | ||
| --- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.