Skip to content
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

Could we get the source model as the body parameter from TCGC when a model is spread as parameters? #1183

Closed
ArcturusZhang opened this issue Jul 17, 2024 · 1 comment
Labels
lib:tcgc Issues for @azure-tools/typespec-client-generator-core library

Comments

@ArcturusZhang
Copy link
Member

For this typespec:

model Bar {}
model Baz {}
op foo(...Bar): Baz;

the TCGC result gives us a FooRequest as the model of body parameter. Since it is speading model Bar, could we get back the model Bar as the body parameter in this case?
This help us reduce the size of the generated assembly.

We agree that there are cases that returning the original model is not possible, such as an operation with spread of two different models, in those cases, we could still do the FooRequest as body because it is combining the two models.
But we would like to get the model back if the model is there.

@ArcturusZhang ArcturusZhang added the lib:tcgc Issues for @azure-tools/typespec-client-generator-core library label Jul 17, 2024
@iscai-msft
Copy link
Contributor

closing in favor of #1132

Will copy paste your comment into the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lib:tcgc Issues for @azure-tools/typespec-client-generator-core library
Projects
None yet
Development

No branches or pull requests

2 participants