forked from loafle/openapi-generator-original
Fix for regression in issue: https://github.com/swagger-api/swagger-codegen/issues/6472 (#6480)
This commit is contained in:
committed by
wing328
parent
e90a40bfce
commit
e6d4362012
@@ -656,7 +656,16 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
||||
return null;
|
||||
}
|
||||
|
||||
return String.format(pattern, getTypeDeclaration(ap.getItems()));
|
||||
String typeDeclaration = getTypeDeclaration(ap.getItems());
|
||||
Object java8obj = additionalProperties.get("java8");
|
||||
if (java8obj != null) {
|
||||
Boolean java8 = Boolean.valueOf(java8obj.toString());
|
||||
if (java8 != null && java8) {
|
||||
typeDeclaration = "";
|
||||
}
|
||||
}
|
||||
|
||||
return String.format(pattern, typeDeclaration);
|
||||
} else if (p instanceof MapProperty) {
|
||||
final MapProperty ap = (MapProperty) p;
|
||||
final String pattern;
|
||||
@@ -669,7 +678,16 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
||||
return null;
|
||||
}
|
||||
|
||||
return String.format(pattern, String.format("String, %s", getTypeDeclaration(ap.getAdditionalProperties())));
|
||||
String typeDeclaration = String.format("String, %s", getTypeDeclaration(ap.getAdditionalProperties()));
|
||||
Object java8obj = additionalProperties.get("java8");
|
||||
if (java8obj != null) {
|
||||
Boolean java8 = Boolean.valueOf(java8obj.toString());
|
||||
if (java8 != null && java8) {
|
||||
typeDeclaration = "";
|
||||
}
|
||||
}
|
||||
|
||||
return String.format(pattern, typeDeclaration);
|
||||
} else if (p instanceof IntegerProperty) {
|
||||
IntegerProperty dp = (IntegerProperty) p;
|
||||
if (dp.getDefault() != null) {
|
||||
|
||||
Reference in New Issue
Block a user