Skip to content

Commit 1b47ca7

Browse files
committed
include child in all its super types
1 parent 8a2a959 commit 1b47ca7

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,13 +183,14 @@ public Map<String, Object> postProcessAllModels(Map<String, Object> objs) {
183183
// Let parent know about all its children
184184
for (String name : allModels.keySet()) {
185185
CodegenModel cm = allModels.get(name);
186-
if (cm.parent == null) continue;
187186
CodegenModel parent = allModels.get(cm.parent);
188-
if (parent == null) continue;
189-
if (parent.children == null) {
190-
parent.children = new ArrayList<CodegenModel>();
187+
while (parent != null) {
188+
if (parent.children == null) {
189+
parent.children = new ArrayList<CodegenModel>();
190+
}
191+
parent.children.add(cm);
192+
parent = allModels.get(parent.parent);
191193
}
192-
parent.children.add(cm);
193194
}
194195
}
195196
return objs;

0 commit comments

Comments
 (0)