-
Notifications
You must be signed in to change notification settings - Fork 40
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
[TCGC] Change the responses
and exceptions
to be arrays
#1540
[TCGC] Change the responses
and exceptions
to be arrays
#1540
Conversation
All changed packages have been documented.
Show changes
|
You can try these changes here
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @ArcturusZhang
…nge-response-to-be-array
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since responses are always small collection. i'm ok with this change as long as all languages have consensus.
.chronus/changes/change-response-to-be-array-2024-8-14-11-27-13.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to also provide the migration guide for emitters as this is a breaking change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
8adc5b1
into
Azure:release/september-2024
Fixes Azure#1453 This is a breaking change in TCGC, but there are some reasons of making this change: 1. The `HttpOperation.responses` from typespec core library also defines as an array. 2. The type `Map` is not persistable in typescript, which causes issues in some emitter implementation such as dotnet, because it needs to serialize everything in TCGC output and sends it to the generator written in other language (details [here](Azure/autorest.csharp#5028)) 3. In most cases, we have no more than 4 responses corresponding different status codes. In the majority of cases, we have 2 or 1. In such a small collections, maps do not have distinguishable performance improvement comparing with arrays with `find`, and arrays have the advantages above.
Fixes Azure#1453 This is a breaking change in TCGC, but there are some reasons of making this change: 1. The `HttpOperation.responses` from typespec core library also defines as an array. 2. The type `Map` is not persistable in typescript, which causes issues in some emitter implementation such as dotnet, because it needs to serialize everything in TCGC output and sends it to the generator written in other language (details [here](Azure/autorest.csharp#5028)) 3. In most cases, we have no more than 4 responses corresponding different status codes. In the majority of cases, we have 2 or 1. In such a small collections, maps do not have distinguishable performance improvement comparing with arrays with `find`, and arrays have the advantages above.
Fixes #1453
This is a breaking change in TCGC, but there are some reasons of making this change:
HttpOperation.responses
from typespec core library also defines as an array.Map
is not persistable in typescript, which causes issues in some emitter implementation such as dotnet, because it needs to serialize everything in TCGC output and sends it to the generator written in other language (details here)find
, and arrays have the advantages above.