Skip to content

Commit a2ffea4

Browse files
authored
Merge pull request #929 from swagger-api/codegen-issues-11049
fixed NPE on spring generator when using discriminator mapping
2 parents 6c433e8 + a029479 commit a2ffea4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/main/java/io/swagger/codegen/v3/generators/java/SpringCodegen.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,11 @@ protected List<Map<String, Object>> modelInheritanceSupport(List<?> allModels) {
876876
Map<String, Object> parent = new HashMap<>();
877877
parent.put("classname", parentModel.classname);
878878
List<CodegenModel> childrenModels = byParent.get(parentModel);
879+
880+
if (childrenModels == null || childrenModels.isEmpty()) {
881+
continue;
882+
}
883+
879884
for (CodegenModel model : childrenModels) {
880885
Map<String, Object> child = new HashMap<>();
881886
child.put("name", model.name);

0 commit comments

Comments
 (0)