Azure / typespec-azure

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

bug(tcgc): default name of api version parameter should be `api-version` #1046

Closed archerzz closed 2 weeks ago

archerzz commented 2 weeks ago

Clear and concise description of the problem

Try to parse a tsp spec without specific api version parameter, like https://github.com/Azure/autorest.csharp/blob/5ff421832c6037a563b346407cad1a781933bf2c/test/TestProjects/MixAPIVersion-TypeSpec/MixAPIVersion-TypeSpec.tsp#L12-L27

TCGC will output a default api version parameter of which the name is apiVersion. I think for Azure flavor, TCGC should use api-version as the name.

Checklist

archerzz commented 2 weeks ago

Looks like it's due to emitter's implementation. We should prefer serializedName over name.