With #282 the casing of generated Enums was changed from some broken/inconsistent state to using PascalCase as default. While the TypeScript docs also uses PascalCase in the examples, I think it would be good to have a config option, to change it.
The TypeScript generators listed on openapi-generator.tech all have an enumPropertyNaming option which allows:
camelCase
PascalCase
snake_case
UPPERCASE
original
From my understanding this is the place where the config value should be read and matching formatter should be called:
|
enumName = pascal(enumName); |
Also the filenameCase option already have more or less the values this new config option would need:
|
filenameCase?: keyof Pick<typeof c, "snake" | "camel" | "kebab" | "pascal">; |
Overall this shouldn't be a complicated but much appreciated change.
Please let me know if you need any more information on this.
With #282 the casing of generated Enums was changed from some broken/inconsistent state to using PascalCase as default. While the TypeScript docs also uses PascalCase in the examples, I think it would be good to have a config option, to change it.
The TypeScript generators listed on openapi-generator.tech all have an
enumPropertyNamingoption which allows:camelCasePascalCasesnake_caseUPPERCASEoriginalFrom my understanding this is the place where the config value should be read and matching formatter should be called:
openapi-codegen/plugins/typescript/src/core/schemaToEnumDeclaration.ts
Line 79 in 4c0f669
Also the
filenameCaseoption already have more or less the values this new config option would need:openapi-codegen/plugins/typescript/src/generators/types.ts
Line 27 in 4c0f669
Overall this shouldn't be a complicated but much appreciated change.
Please let me know if you need any more information on this.