Generating TypeScript APIs with OpenAPI Generator and Keeping Attribute Names Unchanged
Possawat Sanorkam

Possawat Sanorkam @parmcoder

About: I'm a casual gamer and a full stack dev.

Location:
Bangkok, Thailand
Joined:
Jul 13, 2022

Generating TypeScript APIs with OpenAPI Generator and Keeping Attribute Names Unchanged

Publish Date: Jan 12 '23
1 0

To generate the API in TypeScript with the attribute name's first letter not capitalized, you can use the --model-name-prefix option in the openapi-generator-cli command. This will allow you to specify a prefix that will be added to the beginning of all generated model names. For example:

openapi-generator-cli generate -i /path/to/spec.yaml -g typescript-fetch -o /output/directory --model-name-prefix=''
Enter fullscreen mode Exit fullscreen mode

This will generate the TypeScript API in the specified output directory, and the attribute names in the generated models will have the first letter not capitalized.

Comments 0 total

    Add comment