Allow some values to be use in templates#43
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.
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.