typescript-rest-swagger icon indicating copy to clipboard operation
typescript-rest-swagger copied to clipboard

I have a requirement to change camelcase to snake_case properties. Is that possible?

Open rolfwessels opened this issue 4 years ago • 0 comments

Currently the output is as follows

properties:
            version:
                type: string
            serviceStartDate:
                type: string

I need it to be

properties:
            version:
                type: string
            service_start_date:
                type: string

I know I can rename the properties but I would like to automate this if possible. Something like swaggerConfig.json

...
  "swagger": {
    "outputFormat": "openapi_3",
    "propertyNameTransformer": "toSnakeCase",
}

Does this feature exist? Or if you point me to the right place I can have a look at implementing something like this.

rolfwessels avatar Apr 21 '20 11:04 rolfwessels