-
Notifications
You must be signed in to change notification settings - Fork 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
[JAVA] import mappings in model generation are ignored by default #10419
[JAVA] import mappings in model generation are ignored by default #10419
Comments
The same problem is in V3 codegen (latest). On the beginning it is false, but at some point before handling importSettings has true value (when not set, as above or in code), so the list is ignored :( |
I was experiencing a similar problem with v2.4.19: The Adding |
I also ran into this and screwed me up seriously - while developing a customized codegen (extends JavaClientCodegen, which extends AbstractJavaCodegen) Unless you explicitly provide the Please note that the superclass of every Java code generation ( I'm spending time around this option for a while now and I have the feeling it is not really a coincidence... Because the orchestrator of the whole generation,
The point is that in case that But this is just a feeling so far. I would not say (yet) I get the situation 100% already but based on what I saw in the code so far I guess author(s) of Java codegen classes did not count in some side effects of this move. One clear side effect is that the classes will be generated anyways - however |
Same problem on the latest 3.0.37 version. Took me quite some time to figure out what (I assumed) I was doing wrong. Fixed it for now using the following gradle config (thnx to the comments above): swaggerSources {
myModel {
inputFile = file('src/main/resources/spec.yaml')
code {
// ...
additionalProperties = [
"ignoreImportMappings": "false"
]
}
} |
Description
Since #9981 I have to specify an additional Property
ignoreImportMappings=false
to useimportMappings
. The JavaCodegen ist the only Codegen where the default is to ignore definedimportMappings
. Imho the default should be inverted - it was really hard to find the cause for the not workingimportMappings
after updating the plugin.Swagger-codegen version
2.4.12 and above
Swagger declaration file content or url
Suggest a fix/enhancement
Remove the default in https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java, so the default from https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java is used.
The text was updated successfully, but these errors were encountered: