Skip to content

Commit ea65ca4

Browse files
mvarchdevzapodot
authored andcommitted
fix: when instantiation type is not defined for language, return type itself for parent (OpenAPITools#18164)
1 parent b63a1a7 commit ea65ca4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2059,7 +2059,11 @@ public String toInstantiationType(Schema schema) {
20592059
if (ModelUtils.isMapSchema(schema)) {
20602060
Schema additionalProperties = ModelUtils.getAdditionalProperties(schema);
20612061
String inner = getSchemaType(additionalProperties);
2062-
return instantiationTypes.get("map") + "<String, " + inner + ">";
2062+
String mapInstantion = instantiationTypes.get("map");
2063+
if (mapInstantion != null) {
2064+
return mapInstantion + "<String, " + inner + ">";
2065+
}
2066+
return inner;
20632067
} else if (ModelUtils.isArraySchema(schema)) {
20642068
ArraySchema arraySchema = (ArraySchema) schema;
20652069
String inner = getSchemaType(getSchemaItems(arraySchema));

0 commit comments

Comments
 (0)