@@ -927,7 +927,7 @@ else if (Parameter.StyleEnum.SPACEDELIMITED.equals(queryParameter.getStyle())) {
927
927
* @return string presentation of the instantiation type of the property
928
928
*/
929
929
public String toInstantiationType (Schema property ) {
930
- if (property instanceof MapSchema || property .getAdditionalProperties () != null ) {
930
+ if (property instanceof MapSchema || ( property .getAdditionalProperties () != null && ( property . getAdditionalProperties () instanceof Schema )) ) {
931
931
Schema additionalProperties = (Schema ) property .getAdditionalProperties ();
932
932
String type = additionalProperties .getType ();
933
933
if (null == type ) {
@@ -1053,7 +1053,7 @@ private static String getTypeOfSchema(Schema schema) {
1053
1053
return "string" ;
1054
1054
} else {
1055
1055
if (schema != null ) {
1056
- if (SchemaTypeUtil .OBJECT_TYPE .equals (schema .getType ()) && schema .getAdditionalProperties () != null ) {
1056
+ if (SchemaTypeUtil .OBJECT_TYPE .equals (schema .getType ()) && schema .getAdditionalProperties () != null && ( schema . getAdditionalProperties () instanceof Schema ) ) {
1057
1057
return "map" ;
1058
1058
} else {
1059
1059
return schema .getType ();
@@ -1331,7 +1331,7 @@ else if (schema instanceof ComposedSchema) {
1331
1331
codegenModel .allowableValues = new HashMap <String , Object >();
1332
1332
codegenModel .allowableValues .put ("values" , schema .getEnum ());
1333
1333
}
1334
- if (schema .getAdditionalProperties () != null ) {
1334
+ if (schema .getAdditionalProperties () != null && ( schema . getAdditionalProperties () instanceof Schema ) ) {
1335
1335
addAdditionPropertiesToCodeGenModel (codegenModel , schema );
1336
1336
}
1337
1337
addVars (codegenModel , schema .getProperties (), schema .getRequired ());
@@ -1649,7 +1649,7 @@ public CodegenProperty fromProperty(String name, Schema propertySchema) {
1649
1649
Schema items = ((ArraySchema ) propertySchema ).getItems ();
1650
1650
CodegenProperty innerCodegenProperty = fromProperty (itemName , items );
1651
1651
updatePropertyForArray (codegenProperty , innerCodegenProperty );
1652
- } else if (propertySchema instanceof MapSchema || propertySchema .getAdditionalProperties () != null ) {
1652
+ } else if (propertySchema instanceof MapSchema || (( propertySchema .getAdditionalProperties () != null && ( propertySchema . getAdditionalProperties () instanceof Schema ))) ) {
1653
1653
1654
1654
codegenProperty .getVendorExtensions ().put (CodegenConstants .IS_CONTAINER_EXT_NAME , Boolean .TRUE );
1655
1655
codegenProperty .getVendorExtensions ().put (CodegenConstants .IS_MAP_CONTAINER_EXT_NAME , Boolean .TRUE );
0 commit comments