This commit is contained in:
Jean-François Côté
2017-10-09 10:51:32 -04:00
committed by wing328
parent e90a40bfce
commit e6d4362012
7 changed files with 32 additions and 14 deletions

View File

@@ -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) {

View File

@@ -112,8 +112,8 @@
"type" : "array",
"items" : {
"type" : "string",
"enum" : [ "available", "pending", "sold" ],
"default" : "available"
"default" : "available",
"enum" : [ "available", "pending", "sold" ]
},
"collectionFormat" : "csv"
} ],

View File

@@ -112,8 +112,8 @@
"type" : "array",
"items" : {
"type" : "string",
"enum" : [ "available", "pending", "sold" ],
"default" : "available"
"default" : "available",
"enum" : [ "available", "pending", "sold" ]
},
"collectionFormat" : "csv"
} ],

View File

@@ -112,8 +112,8 @@
"type" : "array",
"items" : {
"type" : "string",
"enum" : [ "available", "pending", "sold" ],
"default" : "available"
"default" : "available",
"enum" : [ "available", "pending", "sold" ]
},
"collectionFormat" : "csv"
} ],

View File

@@ -112,8 +112,8 @@
"type" : "array",
"items" : {
"type" : "string",
"enum" : [ "available", "pending", "sold" ],
"default" : "available"
"default" : "available",
"enum" : [ "available", "pending", "sold" ]
},
"collectionFormat" : "csv"
} ],

View File

@@ -112,8 +112,8 @@
"type" : "array",
"items" : {
"type" : "string",
"enum" : [ "available", "pending", "sold" ],
"default" : "available"
"default" : "available",
"enum" : [ "available", "pending", "sold" ]
},
"collectionFormat" : "csv"
} ],

View File

@@ -112,8 +112,8 @@
"type" : "array",
"items" : {
"type" : "string",
"enum" : [ "available", "pending", "sold" ],
"default" : "available"
"default" : "available",
"enum" : [ "available", "pending", "sold" ]
},
"collectionFormat" : "csv"
} ],