Skip to content

Commit

Permalink
fix #4370 - bundle oneOf/anyOf/allOf as with explict prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
frantuma committed Mar 1, 2023
1 parent e7d277e commit 4f9da67
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ public Schema resolve(AnnotatedType annotatedType, ModelConverterContext context
.collect(Collectors.toList());
allOfFiltered.forEach(c -> {
Schema allOfRef = context.resolve(new AnnotatedType().type(c).jsonViewAnnotation(annotatedType.getJsonViewAnnotation()));
Schema refSchema = new Schema().$ref(allOfRef.getName());
Schema refSchema = new Schema().$ref(Components.COMPONENTS_SCHEMAS_REF + allOfRef.getName());
if (StringUtils.isBlank(allOfRef.getName())) {
refSchema = allOfRef;
}
Expand All @@ -826,7 +826,7 @@ public Schema resolve(AnnotatedType annotatedType, ModelConverterContext context
anyOfFiltered.forEach(c -> {
Schema anyOfRef = context.resolve(new AnnotatedType().type(c).jsonViewAnnotation(annotatedType.getJsonViewAnnotation()));
if (StringUtils.isNotBlank(anyOfRef.getName())) {
composedSchema.addAnyOfItem(new Schema().$ref(anyOfRef.getName()));
composedSchema.addAnyOfItem(new Schema().$ref(Components.COMPONENTS_SCHEMAS_REF + anyOfRef.getName()));
} else {
composedSchema.addAnyOfItem(anyOfRef);
}
Expand All @@ -848,7 +848,7 @@ public Schema resolve(AnnotatedType annotatedType, ModelConverterContext context
if (StringUtils.isBlank(oneOfRef.getName())) {
composedSchema.addOneOfItem(oneOfRef);
} else {
composedSchema.addOneOfItem(new Schema().$ref(oneOfRef.getName()));
composedSchema.addOneOfItem(new Schema().$ref(Components.COMPONENTS_SCHEMAS_REF + oneOfRef.getName()));
}
// remove shared properties defined in the parent
if (isSubtype(beanDesc.getClassInfo(), c)) {
Expand Down

0 comments on commit 4f9da67

Please sign in to comment.