Skip to content

Commit 5950b3e

Browse files
committed
WebFlux functional DSL does not recognise query parameters. Fixes #971.
1 parent e30d384 commit 5950b3e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

springdoc-openapi-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
import org.springdoc.core.fn.RouterFunctionData;
8585
import org.springdoc.core.fn.RouterOperation;
8686

87+
import org.springframework.aop.support.AopUtils;
8788
import org.springframework.beans.factory.ObjectFactory;
8889
import org.springframework.context.ApplicationContext;
8990
import org.springframework.core.annotation.AnnotatedElementUtils;
@@ -424,14 +425,16 @@ protected void calculatePath(List<RouterOperation> routerOperationList) {
424425
if (routerOperation.getBeanClass() != null && !Void.class.equals(routerOperation.getBeanClass())) {
425426
Object handlerBean = applicationContext.getBean(routerOperation.getBeanClass());
426427
HandlerMethod handlerMethod = null;
428+
427429
if (StringUtils.isNotBlank(routerOperation.getBeanMethod())) {
428430
try {
429431
if (ArrayUtils.isEmpty(routerOperation.getParameterTypes())) {
430-
Optional<Method> methodOptional = Arrays.stream(handlerBean.getClass().getDeclaredMethods())
432+
Method[] declaredMethods = AopUtils.getTargetClass(handlerBean).getDeclaredMethods();
433+
Optional<Method> methodOptional = Arrays.stream(declaredMethods)
431434
.filter(method -> routerOperation.getBeanMethod().equals(method.getName()) && method.getParameters().length == 0)
432435
.findAny();
433436
if (!methodOptional.isPresent())
434-
methodOptional = Arrays.stream(handlerBean.getClass().getDeclaredMethods())
437+
methodOptional = Arrays.stream(declaredMethods)
435438
.filter(method1 -> routerOperation.getBeanMethod().equals(method1.getName()))
436439
.findAny();
437440
if (methodOptional.isPresent())

0 commit comments

Comments
 (0)