forked from loafle/openapi-generator-original
fix: avoid generic NPE when refering to missing schema (#11718)
This commit is contained in:
parent
d1708294c2
commit
d20a32f1f7
@ -565,6 +565,9 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
parent.getChildren().add(cm);
|
||||
parent.hasChildren = true;
|
||||
Schema parentSchema = this.openAPI.getComponents().getSchemas().get(parent.name);
|
||||
if (parentSchema == null) {
|
||||
throw new NullPointerException(parent.name+" in "+this.openAPI.getComponents().getSchemas());
|
||||
}
|
||||
if (parentSchema.getDiscriminator() == null) {
|
||||
parent = allModels.get(parent.getParent());
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user