Skip to content

Commit eeefac4

Browse files
author
springdoc
committed
fixes #160
1 parent 3a3db24 commit eeefac4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package org.springdoc.core;
22

33
import com.fasterxml.jackson.annotation.JsonView;
4-
import io.swagger.v3.core.util.ReflectionUtils;
54
import org.apache.commons.lang3.ArrayUtils;
5+
import org.springframework.core.annotation.AnnotatedElementUtils;
66
import org.springframework.http.MediaType;
77
import org.springframework.web.bind.annotation.*;
88

@@ -52,27 +52,27 @@ public String[] getMethodConsumes() {
5252

5353

5454
public void calculateConsumesProduces(Method method) {
55-
PostMapping reqPostMappringMethod = ReflectionUtils.getAnnotation(method, PostMapping.class);
55+
PostMapping reqPostMappringMethod = AnnotatedElementUtils.findMergedAnnotation(method, PostMapping.class);
5656
if (reqPostMappringMethod != null) {
5757
fillMethods(reqPostMappringMethod.produces(), reqPostMappringMethod.consumes());
5858
return;
5959
}
60-
GetMapping reqGetMappringMethod = ReflectionUtils.getAnnotation(method, GetMapping.class);
60+
GetMapping reqGetMappringMethod = AnnotatedElementUtils.findMergedAnnotation(method, GetMapping.class);
6161
if (reqGetMappringMethod != null) {
6262
fillMethods(reqGetMappringMethod.produces(), reqGetMappringMethod.consumes());
6363
return;
6464
}
65-
DeleteMapping reqDeleteMappringMethod = ReflectionUtils.getAnnotation(method, DeleteMapping.class);
65+
DeleteMapping reqDeleteMappringMethod = AnnotatedElementUtils.findMergedAnnotation(method, DeleteMapping.class);
6666
if (reqDeleteMappringMethod != null) {
6767
fillMethods(reqDeleteMappringMethod.produces(), reqDeleteMappringMethod.consumes());
6868
return;
6969
}
70-
PutMapping reqPutMappringMethod = ReflectionUtils.getAnnotation(method, PutMapping.class);
70+
PutMapping reqPutMappringMethod = AnnotatedElementUtils.findMergedAnnotation(method, PutMapping.class);
7171
if (reqPutMappringMethod != null) {
7272
fillMethods(reqPutMappringMethod.produces(), reqPutMappringMethod.consumes());
7373
return;
7474
}
75-
RequestMapping reqMappringMethod = ReflectionUtils.getAnnotation(method, RequestMapping.class);
75+
RequestMapping reqMappringMethod = AnnotatedElementUtils.findMergedAnnotation(method, RequestMapping.class);
7676
if (reqMappringMethod != null) {
7777
fillMethods(reqMappringMethod.produces(), reqMappringMethod.consumes());
7878
}

0 commit comments

Comments
 (0)