microsoft / typespec

https://typespec.io/
MIT License
4.48k stars 210 forks source link

refactor(http-client-csharp): do not expand client parameters into each operation #4161

Open archerzz opened 2 months ago

archerzz commented 2 months ago

Description

Previously when adopting TCGC getAllOperations, we expand client parameters into each operation to keep the existing input model structure: https://github.com/microsoft/typespec/blob/81f897739eed8b481d2e07de8fe9770ba9f44994/packages/http-client-csharp/emitter/src/lib/operation-converter.ts#L152

We could remove this expansion, change the input model, and do the expansion in mgc/autorest.csharp if necessary.

JoshLove-msft commented 2 months ago

Client parameters may not need to be added into each operation, instead they can be added into the client constructor only.