[feature #1255] fix import problem pointed out during review.

Instead of declaring `Map` and `List` as primitive (which caused them
to be not imported anymore), now we exclude them from the model name
transformation in `JavaClientCodegen.getSwaggerType`.
This commit is contained in:
Paul Ebermann
2016-02-24 16:43:20 +01:00
parent 0ee77636a3
commit 70bcf22c82

View File

@@ -219,9 +219,6 @@ public class JavaClientCodegen extends DefaultCodegen implements CodegenConfig {
importMapping.remove("DateTime");
instantiationTypes.put("array", "java.util.ArrayList");
instantiationTypes.put("map", "java.util.HashMap");
} else {
languageSpecificPrimitives.add("List");
languageSpecificPrimitives.add("Map");
}
this.sanitizeConfig();
@@ -490,7 +487,8 @@ public class JavaClientCodegen extends DefaultCodegen implements CodegenConfig {
String type = null;
if (typeMapping.containsKey(swaggerType)) {
type = typeMapping.get(swaggerType);
if (languageSpecificPrimitives.contains(type) || type.indexOf(".") >= 0) {
if (languageSpecificPrimitives.contains(type) || type.indexOf(".") >= 0 ||
type.equals("Map") || type.equals("List")) {
return type;
}
} else {