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.getChildren().add(cm);
|
||||||
parent.hasChildren = true;
|
parent.hasChildren = true;
|
||||||
Schema parentSchema = this.openAPI.getComponents().getSchemas().get(parent.name);
|
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) {
|
if (parentSchema.getDiscriminator() == null) {
|
||||||
parent = allModels.get(parent.getParent());
|
parent = allModels.get(parent.getParent());
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user