Skip to content

Commit 4c14c85

Browse files
demonfiddlerwing328
authored andcommitted
Add additional properties to Java CodegenModel (#1854)
Fixes the first part of #1729 (comment) (see #1729 (comment)). The second part was fixed by #1845 (commit d65dd76).
1 parent 9331df7 commit 4c14c85

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1436,4 +1436,13 @@ public void setParentVersion(final String parentVersion) {
14361436
public void setParentOverridden(final boolean parentOverridden) {
14371437
this.parentOverridden = parentOverridden;
14381438
}
1439+
1440+
@Override
1441+
protected void addAdditionPropertiesToCodeGenModel(CodegenModel codegenModel, Schema schema) {
1442+
super.addAdditionPropertiesToCodeGenModel(codegenModel, schema);
1443+
1444+
// See https://github.com/OpenAPITools/openapi-generator/pull/1729#issuecomment-449937728
1445+
codegenModel.additionalPropertiesType = getSchemaType(ModelUtils.getAdditionalProperties(schema));
1446+
addImport(codegenModel, codegenModel.additionalPropertiesType);
1447+
}
14391448
}

0 commit comments

Comments
 (0)