diff --git a/spring-cloud-gateway-server-mvc/src/main/java/org/springframework/cloud/gateway/server/mvc/config/GatewayMvcPropertiesBeanDefinitionRegistrar.java b/spring-cloud-gateway-server-mvc/src/main/java/org/springframework/cloud/gateway/server/mvc/config/GatewayMvcPropertiesBeanDefinitionRegistrar.java index 01e2d74d1..886647452 100644 --- a/spring-cloud-gateway-server-mvc/src/main/java/org/springframework/cloud/gateway/server/mvc/config/GatewayMvcPropertiesBeanDefinitionRegistrar.java +++ b/spring-cloud-gateway-server-mvc/src/main/java/org/springframework/cloud/gateway/server/mvc/config/GatewayMvcPropertiesBeanDefinitionRegistrar.java @@ -165,13 +165,12 @@ public class GatewayMvcPropertiesBeanDefinitionRegistrar implements ImportBeanDe private void translate(MultiValueMap operations, String operationName, Map operationArgs, Class returnType, Consumer operationHandler) { String normalizedName = StringUtils.uncapitalize(operationName); - Optional filterOperationMethod = operations.get(normalizedName).stream() - .filter(operationMethod -> matchOperation(operationMethod, operationArgs)).findFirst(); - if (filterOperationMethod.isPresent()) { - ReflectiveOperationInvoker operationInvoker = new ReflectiveOperationInvoker(filterOperationMethod.get(), + Optional operationMethod = operations.get(normalizedName).stream() + .filter(opeMethod -> matchOperation(opeMethod, operationArgs)).findFirst(); + if (operationMethod.isPresent()) { + ReflectiveOperationInvoker operationInvoker = new ReflectiveOperationInvoker(operationMethod.get(), this.parameterValueMapper); - Map args = new HashMap<>(); - args.putAll(operationArgs); + Map args = new HashMap<>(operationArgs); InvocationContext context = new InvocationContext(args, trueNullOperationArgumentResolver); T handlerFilterFunction = operationInvoker.invoke(context); if (handlerFilterFunction != null) {