-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix incorrect enum values for typescript clients #7370
Conversation
* Properly decode $ref fixes #5720 * Specify decoding encoding * Nicer syntax * UTF-8 typo * Unescape special characters * Change order of unescaping to prevent escaped sequences by accident * Comment for special decoding Co-authored-by: Jim Schubert <[email protected]> * Add unit test for simple ref decoding Co-authored-by: Jim Schubert <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -690,9 +690,9 @@ private String getNameUsingEnumPropertyNaming(String name) { | |||
case original: | |||
return name; | |||
case camelCase: | |||
return camelize(name, true); | |||
return camelize(StringUtils.lowerCase(name), true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this breaks the behavior if e.g. name
is someEnumValue
, which would incorrectly result in someenumvalue
, as opposed to someEnumValue
case PascalCase: | ||
return camelize(name); | ||
return camelize(StringUtils.lowerCase(name)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this breaks the behavior if e.g. name
is someEnumValue
, which would incorrectly result in someenumvalue
, as opposed to SomeEnumValue
this is a breaking change, but the fallback is to use |
# Conflicts: # modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java # modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/TypeScriptAxiosClientCodegenTest.java
replaced by #7378 |
fixes #7369
Enum values are generated incorrectly for PascalCase enum property naming type when the source enum values are in uppercase with underscores.
PR checklist
./bin/generate-samples.sh
to update all Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master. These must match the expectations made by your contribution. You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example./bin/generate-samples.sh bin/configs/java*
. For Windows users, please run the script in Git BASH.master