Skip to content

Commit c191bcd

Browse files
committed
added parent if it was not assigned by parser on allOf composed model
1 parent c30a364 commit c191bcd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1398,6 +1398,12 @@ public CodegenModel fromModel(String name, Model model, Map<String, Model> allDe
13981398
List<String> required = new ArrayList<String>();
13991399
Map<String, Property> allProperties;
14001400
List<String> allRequired;
1401+
1402+
List<Model> allComponents = composed.getAllOf();
1403+
if (allComponents.size() > 0 && composed.getParent() == null) {
1404+
composed.setParent(allComponents.get(0));
1405+
}
1406+
14011407
if (supportsInheritance || supportsMixins) {
14021408
allProperties = new LinkedHashMap<String, Property>();
14031409
allRequired = new ArrayList<String>();

0 commit comments

Comments
 (0)