Skip to content

Commit 82bf87e

Browse files
kenzhang-mark43frantuma
authored andcommitted
schema name null fix
This is to fix the issue mentioned here springdoc/springdoc-openapi#1266
1 parent 4066aa3 commit 82bf87e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/swagger-core/src/main/java/io/swagger/v3/core/jackson/ModelResolver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,7 @@ public Schema resolve(AnnotatedType annotatedType, ModelConverterContext context
867867
StringUtils.isNotBlank(model.getName()))
868868
{
869869
if (context.getDefinedModels().containsKey(model.getName())) {
870-
model = new Schema().$ref(constructRef(model.getName()));
870+
model = new Schema().name(model.getName()).$ref(constructRef(model.getName()));
871871
}
872872
} else if (model != null && model.get$ref() != null) {
873873
model = new Schema().$ref(StringUtils.isNotEmpty(model.get$ref()) ? model.get$ref() : model.getName());

0 commit comments

Comments
 (0)