oazapfts
oazapfts copied to clipboard
Adding an option to generate typescript enum instead of union of strings
Adds enum generation option
Using the CLI or the API passing the option --useEnumType
will convert the enums to typescript enums instead of using a union of strings.
This solves #27.
Why not use components
The components property is only available on the OpenAPI v3. Therefore to make it compatible with the OpenAPI v2 I analyzed the enum values and created the enums based on their title property or in the lack of it the name of the property.
Added some tests and documentation to match this new feature.