Azure / typespec-azure

About TypeSpec Azure Libraries
https://azure.github.io/typespec-azure/
MIT License
15 stars 41 forks source link

[tcgc] refine the story of method override #1841

Open tadelesh opened 4 days ago

tadelesh commented 4 days ago

currently, we have @override decorator in TCGC to redefine an operation in client.tsp, which is useful for option bags, parameter reordering, etc. however it has not been adopted to all language's emitter since they are not using SdkServiceMethod for now. also, the current implementation does not cover the feature like ignore optional param for specific language, handling bubble up client parameter, etc. open this issue to try to get a solid story for method override.

tadelesh commented 3 days ago

two main problems need to discuss:

  1. language has own logic to group or order parameters, which is hard for emitters to fully rely on the method parameters signature. then, how could emitter partially use the tcgc service method info? for example, how do emitter know there should be an option bag.
  2. currently, the override method must have same corresponding parameters with original one, but we do receive ask that need to omit optional parameter for specific reason when generate clients.