forked from loafle/openapi-generator-original
[feature #1255] Java: Use super.toModelName to allow prefix/Suffix addition.
This allows using the model name prefix and suffix parameters also in Java generators. We add List and Map to the "language specific primitives" so they don't get mangled by the suffixes/prefixes in `getSwaggerType`
This commit is contained in:
parent
087b9118c1
commit
0ee77636a3
@ -219,6 +219,9 @@ public class JavaClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
importMapping.remove("DateTime");
|
importMapping.remove("DateTime");
|
||||||
instantiationTypes.put("array", "java.util.ArrayList");
|
instantiationTypes.put("array", "java.util.ArrayList");
|
||||||
instantiationTypes.put("map", "java.util.HashMap");
|
instantiationTypes.put("map", "java.util.HashMap");
|
||||||
|
} else {
|
||||||
|
languageSpecificPrimitives.add("List");
|
||||||
|
languageSpecificPrimitives.add("Map");
|
||||||
}
|
}
|
||||||
|
|
||||||
this.sanitizeConfig();
|
this.sanitizeConfig();
|
||||||
@ -377,6 +380,7 @@ public class JavaClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toModelName(String name) {
|
public String toModelName(String name) {
|
||||||
|
name = super.toModelName(name);
|
||||||
name = sanitizeName(name); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'.
|
name = sanitizeName(name); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'.
|
||||||
|
|
||||||
// camelize the model name
|
// camelize the model name
|
||||||
|
Loading…
x
Reference in New Issue
Block a user