-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
[typescript-angular] fix: when model property name is sanitized, use instead original property name within quotes in mustache template #19353
Conversation
… instead original property name within quotes in mustache template
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.
Thanks for your contribution!
It seems this change is not backwards-compatible, but on the other hand, I guess the current state for this use case is just broken, so its fine to fix it.
@wing328 can you approve for core?
@wing328 do you plan on merging this soon or there are any issues? |
|
modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenProperty.java
Show resolved
Hide resolved
@@ -3884,6 +3884,7 @@ public CodegenProperty fromProperty(String name, Schema p, boolean required, boo | |||
|
|||
property.name = toVarName(name); | |||
property.baseName = name; | |||
property.setHasSanitizedName(!property.baseName.equals(property.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.
FYI. @OpenAPITools/generator-core-team
can we add a test model with the property name in question to the test spec used by the typescript-angular petstore (fake) sample so that we know what the output looks like and the result works without issue? |
when you've time, can you also please PM me via Slack? https://join.slack.com/t/openapi-generator/shared_invite/zt-12jxxd7p2-XUeQM~4pzsU9x~eGLQqX2g |
as discussed, I think this enhancement should only be applied to "original" modelPropertyNaming (when such option is enabled) you tried the "original" modelPropertyNaming option before but it didn't work for you. i'll investigate further over the weekend. |
closed via #19508 thanks for the PR please pull the latest master to give it a try when you've time |
Fixes #19352
Technical committee
@TiFu (2017/07) @taxpon (2017/07) @sebastianhaas (2017/07) @kenisteward (2017/07) @Vrolijkx (2017/09) @macjohnny (2018/01) @topce (2018/10) @akehir (2019/07) @petejohansonxo (2019/11) @amakhrov (2020/02) @davidgamero (2022/03) @mkusaka (2022/04)
PR checklist
Commit all changed files.
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*
.IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
master
(upcoming 7.6.0 minor release - breaking changes with fallbacks),8.0.x
(breaking changes without fallbacks)