Skip to content

Commit d3c3727

Browse files
committed
code review
1 parent 00e3aed commit d3c3727

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

springdoc-openapi-common/src/main/java/org/springdoc/core/SpringDocAnnotationsUtils.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,8 @@ public static Optional<Content> getContent(io.swagger.v3.oas.annotations.media.C
184184
if (StringUtils.isNotBlank(annotationContent.mediaType())) {
185185
content.addMediaType(annotationContent.mediaType(), mediaType);
186186
}
187-
else {
188-
if (mediaType.getSchema() != null || mediaType.getEncoding() != null || mediaType.getExample() != null || mediaType.getExamples() != null || mediaType.getExtensions() != null)
189-
applyTypes(classTypes, methodTypes, content, mediaType);
190-
}
187+
else if (mediaType.getSchema() != null || mediaType.getEncoding() != null || mediaType.getExample() != null || mediaType.getExamples() != null || mediaType.getExtensions() != null)
188+
applyTypes(classTypes, methodTypes, content, mediaType);
191189
}
192190

193191
if (content.size() == 0 && annotationContents.length != 1) {
@@ -353,7 +351,7 @@ private static MediaType getMediaType(Schema schema, Components components, Json
353351
mediaType.schema(new Schema<Object>().type("object"));
354352
}
355353
Schema oSchema = mediaType.getSchema();
356-
for (SchemaProperty sp: annotationContent.schemaProperties()) {
354+
for (SchemaProperty sp : annotationContent.schemaProperties()) {
357355
Class<?> schemaImplementation = sp.schema().implementation();
358356
boolean isArray = false;
359357
if (schemaImplementation == Void.class) {
@@ -366,7 +364,8 @@ private static MediaType getMediaType(Schema schema, Components components, Json
366364
.ifPresent(s -> {
367365
if ("array".equals(oSchema.getType())) {
368366
oSchema.getItems().addProperty(sp.name(), s);
369-
} else {
367+
}
368+
else {
370369
oSchema.addProperty(sp.name(), s);
371370
}
372371
});
@@ -382,7 +381,8 @@ private static MediaType getMediaType(Schema schema, Components components, Json
382381
.ifPresent(s -> {
383382
if ("array".equals(mediaType.getSchema().getType())) {
384383
mediaType.getSchema().getItems().additionalProperties(s);
385-
} else {
384+
}
385+
else {
386386
mediaType.getSchema().additionalProperties(s);
387387
}
388388
}

0 commit comments

Comments
 (0)