Skip to content

Commit

Permalink
schema name null fix
Browse files Browse the repository at this point in the history
This is to fix the issue mentioned here
springdoc/springdoc-openapi#1266
  • Loading branch information
kenzhang-mark43 authored Jun 3, 2022
1 parent f006b13 commit 76c8cf5
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ public Schema resolve(AnnotatedType annotatedType, ModelConverterContext context
StringUtils.isNotBlank(model.getName()))
{
if (context.getDefinedModels().containsKey(model.getName())) {
model = new Schema().$ref(constructRef(model.getName()));
model = new Schema().name(model.getName()).$ref(constructRef(model.getName()));
}
} else if (model != null && model.get$ref() != null) {
model = new Schema().$ref(StringUtils.isNotEmpty(model.get$ref()) ? model.get$ref() : model.getName());
Expand Down

0 comments on commit 76c8cf5

Please sign in to comment.