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
179 stars 75 forks source link

Optional body parameter is handled differently in HLC and Modular which would cause breakings #2827

Closed MaryGao closed 4 weeks ago

MaryGao commented 2 months ago

Optional body will be put in optional params in HLC but in Modular it would be top-level parameter in method with optional.

see hlc swagger: https://github.com/Azure/autorest.typescript/blob/main/packages/autorest.typescript/test/integration/swaggers/appconfiguration.json#L457-L462 hlc generated code: https://github.com/Azure/autorest.typescript/blob/main/packages/autorest.typescript/test/integration/generated/appconfiguration/src/models/index.ts#L512-L513

modular generated code: https://github.com/Azure/autorest.typescript/blob/main/packages/typespec-ts/test/modularIntegration/generated/parameters/body-optionality/src/index.d.ts#L25-L26

MaryGao commented 4 weeks ago

Offline confirmed with Qiaoqiao, we think this is an un-necessary breaking and we should avoid it. I plan to fix in pr.