-
Notifications
You must be signed in to change notification settings - Fork 317
Emit decorator list #3905
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
Emit decorator list #3905
Conversation
|
API change check APIView has identified API level changes in this PR and created following API reviews. @typespec/http-client-csharp |
|
autorest.csharp regen preview PR: Azure/autorest.csharp#4940 |
packages/http-client-csharp/emitter/src/type/input-decorated-type.ts
Outdated
Show resolved
Hide resolved
...ator.CSharp.ClientModel/test/Providers/MrwSerializationTypeDefinitions/JsonModelCoreTests.cs
Outdated
Show resolved
Hide resolved
8b1ee70 to
5b30017
Compare
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.
Do we have a test case where Decorators is not empty array?
|
Previously I thought it's quite natural to pass decorators to generator. But after seeing the codes, I hesitate, mainly because:
@m-nash @ArcturusZhang your thoughts? |
For #1, we only need to pass some special set(which is small) of decorators which may not common, or be special decorators defined in customized typespec library/emitter. Common decorators we will parse the information to our input model and will not pass to generator #2, I think the swagger |
So we could categorize the decorators into two types: I think this should resolve your first concern. For 2, some extensions will change the spec, for instance some For 3, you might need to specify. It is always painful when we want to convert an unknown type into C#, it is inevitable. |
@ArcturusZhang thanks. For 3, I just found that we could have a I wander if we can identify the type of argument value according to the json-element-type. If not, I will file an request to ask TCGC to emit valueType for the arguments of decorator which will help us to correct convert the value from json. |
Fix microsoft#4031 When we specify the allowed-emit-decorators in emitter, TCGC will help to emit out decoration information for each item (client, property, operation), e.g final-state-var, our .NET input-Model need to contain this information. This PR will - emit decorators to all kind of models, operations and operations - add reference resolve strategy in TypeSpecInputDecoratorInfoConverter to support parse by reference
Fix #4031
When we specify the allowed-emit-decorators in emitter, TCGC will help to emit out decoration information for each item (client, property, operation), e.g final-state-var, our .NET input-Model need to contain this information.
This PR will