mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-05 14:46:10 +00:00
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) {
|
||||
|
||||
@@ -112,8 +112,8 @@
|
||||
"type" : "array",
|
||||
"items" : {
|
||||
"type" : "string",
|
||||
"enum" : [ "available", "pending", "sold" ],
|
||||
"default" : "available"
|
||||
"default" : "available",
|
||||
"enum" : [ "available", "pending", "sold" ]
|
||||
},
|
||||
"collectionFormat" : "csv"
|
||||
} ],
|
||||
|
||||
@@ -112,8 +112,8 @@
|
||||
"type" : "array",
|
||||
"items" : {
|
||||
"type" : "string",
|
||||
"enum" : [ "available", "pending", "sold" ],
|
||||
"default" : "available"
|
||||
"default" : "available",
|
||||
"enum" : [ "available", "pending", "sold" ]
|
||||
},
|
||||
"collectionFormat" : "csv"
|
||||
} ],
|
||||
|
||||
@@ -112,8 +112,8 @@
|
||||
"type" : "array",
|
||||
"items" : {
|
||||
"type" : "string",
|
||||
"enum" : [ "available", "pending", "sold" ],
|
||||
"default" : "available"
|
||||
"default" : "available",
|
||||
"enum" : [ "available", "pending", "sold" ]
|
||||
},
|
||||
"collectionFormat" : "csv"
|
||||
} ],
|
||||
|
||||
@@ -112,8 +112,8 @@
|
||||
"type" : "array",
|
||||
"items" : {
|
||||
"type" : "string",
|
||||
"enum" : [ "available", "pending", "sold" ],
|
||||
"default" : "available"
|
||||
"default" : "available",
|
||||
"enum" : [ "available", "pending", "sold" ]
|
||||
},
|
||||
"collectionFormat" : "csv"
|
||||
} ],
|
||||
|
||||
@@ -112,8 +112,8 @@
|
||||
"type" : "array",
|
||||
"items" : {
|
||||
"type" : "string",
|
||||
"enum" : [ "available", "pending", "sold" ],
|
||||
"default" : "available"
|
||||
"default" : "available",
|
||||
"enum" : [ "available", "pending", "sold" ]
|
||||
},
|
||||
"collectionFormat" : "csv"
|
||||
} ],
|
||||
|
||||
@@ -112,8 +112,8 @@
|
||||
"type" : "array",
|
||||
"items" : {
|
||||
"type" : "string",
|
||||
"enum" : [ "available", "pending", "sold" ],
|
||||
"default" : "available"
|
||||
"default" : "available",
|
||||
"enum" : [ "available", "pending", "sold" ]
|
||||
},
|
||||
"collectionFormat" : "csv"
|
||||
} ],
|
||||
|
||||
Reference in New Issue
Block a user