Skip to content

Commit c78ad1b

Browse files
committed
Add explode support in combination with arrayShema annotation. Fixes #987
1 parent d73091e commit c78ad1b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@
5454
import org.springframework.core.io.Resource;
5555
import org.springframework.web.multipart.MultipartFile;
5656

57-
import static java.util.Objects.isNull;
58-
5957
/**
6058
* The type Generic parameter builder.
6159
* @author bnasslahsen, coutin
@@ -400,9 +398,10 @@ private void setParameterStyle(Parameter parameter, io.swagger.v3.oas.annotation
400398
private boolean isExplodable(io.swagger.v3.oas.annotations.Parameter p) {
401399
io.swagger.v3.oas.annotations.media.Schema schema = p.schema();
402400
io.swagger.v3.oas.annotations.media.ArraySchema arraySchema = p.array();
401+
403402
boolean explode = true;
404403
Class<?> implementation = schema.implementation();
405-
if (implementation == Void.class && !schema.type().equals("object") && !schema.type().equals("array") && isNull(arraySchema)) {
404+
if (implementation == Void.class && !schema.type().equals("object") && !schema.type().equals("array") && !AnnotationsUtils.hasArrayAnnotation(arraySchema)) {
406405
explode = false;
407406
}
408407
return explode;

0 commit comments

Comments
 (0)