Azure / autorest.typescript

Extension for AutoRest (https://github.com/Azure/autorest) that generates TypeScript code. The transpiled javascript code is isomorphic. It can be run in browser and in node.js environment.
MIT License
177 stars 73 forks source link

revisit modular models generation in multi clients #2611

Open qiaozha opened 1 week ago

qiaozha commented 1 week ago

This is the bug from https://github.com/Azure/autorest.typescript/issues/2554 our customers and I have a pr to fix this https://github.com/Azure/autorest.typescript/pull/2556#discussion_r1627958698,the bug is because we didn't add subfolder in the serialize util filepath part, but as getAllModel api doesn't really have a SDKClient parameter, the models are not filtered by clients, what we end up now for multi clients in Modular are just duplicate the models in each sub client's folder, and as serialize and deserialize utils are bind with models, we will have to duplicate that part too right? I think we have three options for this:

  1. keep the way as is now.
  2. to just have one /models subpath export in multi client scenarios, instead of have /subclient/models for each sub client.
  3. ask tcgc to provide api that can filter the models per SDK client, or we can do the filter by ourself, but what about orphan models in this case?