add parent for allOf only (#5851)

This commit is contained in:
William Cheng 2020-04-08 11:04:13 +08:00 committed by GitHub
parent 55f928a82e
commit 41955b104c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2223,7 +2223,7 @@ public class DefaultCodegen implements CodegenConfig {
} }
} }
if (parent != null) { if (parent != null && composed.getAllOf() != null) { // set parent for allOf only
m.parentSchema = parentName; m.parentSchema = parentName;
m.parent = toModelName(parentName); m.parent = toModelName(parentName);