fabien0102 / openapi-codegen

A tool for generating code base on an OpenAPI schema.
491 stars 61 forks source link

Changing default case of schema properties #118

Open stefanbartos opened 1 year ago

stefanbartos commented 1 year ago

Hi,

I have a question about changing the case of generated schema properties.

Our OpenApi specification is generated from .NET API. Since all exported object properties have pascal case by default, generated schemas have also pascal, which is not TS/JS convention. It can be solved by these suggestions.



Which option is better? If none, how should solve this issue?

Thx for your answers.
MbBrainz commented 10 months ago

You'd still need a conversion from what the api returns to your casing though. I was looking for a option to set the casing to camelcase, but the api returns snake_case. If you then generate the types in CamelCase, the conversion from the snake_case json to your CamelCase types would fail.

I would love to see this problem worked out though!