Azure / autorest

OpenAPI (f.k.a Swagger) Specification code generator. Supports C#, PowerShell, Go, Java, Node.js, TypeScript, Python
MIT License
4.6k stars 732 forks source link

[openapi-to-tsp] Model properties should be camel cased #4866

Open catalinaperalta opened 8 months ago

catalinaperalta commented 8 months ago

Some model properties are outputted with pascal case instead of camel case and the typespec linter complains about this.

Example ci failure: https://dev.azure.com/azure-sdk/public/_build/results?buildId=3414121&view=logs&j=011e1ec8-6569-5e69-4f06-baf193d1351e&t=0f4aa080-c997-58ca-481c-4930865ae0f8&l=300

Spec example: https://github.com/Azure/azure-rest-api-specs/blob/1b7a0f826e326dc5aa64605ccb0d08f2184d47ef/specification/translation/Azure.AI.DocumentTranslation/models.tsp#L240

catalinaperalta commented 8 months ago

Also some properties are outputted with a $ before them, we should output these as:

`$top`?: int32

Link to the swagger: https://github.com/Azure/azure-rest-api-specs/blob/1b7a0f826e326dc5aa64605ccb0d08f2184d47ef/specification/cognitiveservices/data-plane/TranslatorText/stable/v1.1/TranslatorBatch.json#L80

Link to generated spec: https://github.com/Azure/azure-rest-api-specs/blob/1b7a0f826e326dc5aa64605ccb0d08f2184d47ef/specification/translation/Azure.AI.DocumentTranslation/routes.tsp#L115

Link to ci failure: https://dev.azure.com/azure-sdk/public/_build/results?buildId=3414121&view=logs&j=011e1ec8-6569-5e69-4f06-baf193d1351e&t=0f4aa080-c997-58ca-481c-4930865ae0f8&l=318

lirenhe commented 7 months ago

@joheredi, as this item is related to data plane, could you take a look? thanks