Skip to content

Commit 121d9ec

Browse files
committed
Fix Schema get condition of ArraySchema. Fixes #2199
1 parent 3ef7413 commit 121d9ec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ private void setSchema(io.swagger.v3.oas.annotations.Parameter parameterDoc, Com
326326
catch (Exception e) {
327327
LOGGER.warn(Constants.GRACEFUL_EXCEPTION_OCCURRED, e);
328328
}
329-
if (schema == null) {
329+
if (schema == null && parameterDoc.array() != null) {
330330
schema = AnnotationsUtils.getSchema(parameterDoc.schema(), parameterDoc.array(), true, parameterDoc.array().schema().implementation(), components, jsonView).orElse(null);
331331
// default value not set by swagger-core for array !
332332
if (schema != null) {
@@ -358,7 +358,7 @@ Schema calculateSchema(Components components, ParameterInfo parameterInfo, Reque
358358
WebConversionServiceProvider webConversionServiceProvider = optionalWebConversionServiceProvider.get();
359359
if (!MethodParameterPojoExtractor.isSwaggerPrimitiveType((Class) type) && methodParameter.getParameterType().getAnnotation(io.swagger.v3.oas.annotations.media.Schema.class) == null) {
360360
Class<?> springConvertedType = webConversionServiceProvider.getSpringConvertedType(methodParameter.getParameterType());
361-
if (!(String.class.equals(springConvertedType) && ((Class<?>) type).isEnum()) && requestBodyInfo==null)
361+
if (!(String.class.equals(springConvertedType) && ((Class<?>) type).isEnum()) && requestBodyInfo == null)
362362
type = springConvertedType;
363363
}
364364
}

0 commit comments

Comments
 (0)