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

Move the flatten handling logic to the generator #4788

Closed
Tracked by #4711
ArcturusZhang opened this issue Jun 3, 2024 · 0 comments · Fixed by #5094
Closed
Tracked by #4711

Move the flatten handling logic to the generator #4788

ArcturusZhang opened this issue Jun 3, 2024 · 0 comments · Fixed by #5094
Assignees
Labels
DPG/RLC v2.1 Post Gallium work DPG v3 Version 3 of AutoRest C# generator.

Comments

@ArcturusZhang
Copy link
Member

ArcturusZhang commented Jun 3, 2024

Now in the property we get from TCGC in the emitter, we only get a flag flatten to show if this has been flattened by adding the decorator @flatten
We need to flatten the property somewhere and put those flattened properties inside this model.
Currently this happens in the emitter.

With the principal that we need to keep the emitter as simple as possible, we should remove it from the emitter.
Two approaches:

  1. TCGC can do this so that every emitter does not have to do this again.
  2. The emitter just emit out whatever it gets from TCGC, and the generator flattens the property when deserializing the output of emitter.
@ArcturusZhang ArcturusZhang added v3 Version 3 of AutoRest C# generator. DPG labels Jun 3, 2024
@ArcturusZhang ArcturusZhang changed the title Move the flatten handling logic out of the emitter to the generator Move the flatten handling logic to the generator Jun 6, 2024
@chunyu3 chunyu3 added the DPG/RLC v2.1 Post Gallium work label Jun 26, 2024
archerzz pushed a commit to archerzz/typespec that referenced this issue Sep 14, 2024
Per discussion, we thought we should not flatten properties in emitter, to keep it as simple as possible.
The flattening logic should be implemented in generator.

part of Azure/autorest.csharp#4788
github-merge-queue bot pushed a commit to microsoft/typespec that referenced this issue Oct 9, 2024
Per discussion, we thought we should not flatten properties in emitter,
to keep it as simple as possible.
The flattening logic should be implemented in generator.

part of Azure/autorest.csharp#4788

---------

Co-authored-by: Mingzhe Huang (from Dev Box) <mingzhehuang@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DPG/RLC v2.1 Post Gallium work DPG v3 Version 3 of AutoRest C# generator.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants