-
Notifications
You must be signed in to change notification settings - Fork 437
Allow some values to be use in templates #43
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
Conversation
* remove @SuppressWarnings("hiding") * organize imports * use constants
| this.setModelPackage((String) additionalProperties.get(CodegenConstants.MODEL_PACKAGE)); | ||
| } else { | ||
| // not set, use to be passed to template | ||
| additionalProperties.put(CodegenConstants.MODEL_PACKAGE, modelPackage); |
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 don't think this could cause an error or something similar, but i'm wondering if you'd need to set modelPackage in additionalProperties if its value is null or empty.
|
Thank you for your feedback. I have added a is null or empty check. To stay consistent, I updated all code location where the same pattern is used. |
|
awesome, thanks ! |
|
@jmini The best approach here is add those changes in the specific language overriding methods in I understand is more work, i can help you with that if you're agree. |
|
basically i will only rever this commit and tweaks test related. |
Existing templates (here or in the
swagger-codegenrepository) are using these values:They need to be available in the
additionalPropertiesmap in order to be consumed from themustachetemplates.In addition, setting the value should be possible using setters. This is usefull when the generators are used directly (no maven plugin or no cli integration). Setter for
hideGenerationTimestamphas been added.invokerPackageis present only inAbstractJavaCodegen. Its value is derived fromapiPackageormodelPackage. Current behavior needs to be preserved this is why some regression tests were implemented first in 7ad6ca2.