{"record":{"id":"d8d592f3ab77fcf5","repo":"quarkusio/quarkus","slug":"annotationname-method-declaringclass-metho","errorCode":null,"errorMessage":"${annotationName} method ${declaringClass}#${methodName} has too many parameters, at most one parameter, param name, expected","messagePattern":"(.+?) method (.+?)#(.+?) has too many parameters, at most one parameter, param name, expected","errorType":"exception","errorClass":"RestClientDefinitionException","httpStatus":null,"severity":"error","filePath":"extensions/resteasy-reactive/rest-client/deployment/src/main/java/io/quarkus/rest/client/reactive/deployment/MicroProfileRestClientEnricher.java","lineNumber":458,"sourceCode":"            } else {\n                // interface method\n                String mockName = mockInterface(declaringClass, generatedClasses, index);\n                ResultHandle interfaceMock = methodCallCreator.newInstance(MethodDescriptor.ofConstructor(mockName));\n\n                paramValueMethod = findMethod(declaringClass, declaringClass, methodName, clientParamAnnotation.toString());\n\n                if (paramValueMethod == null) {\n                    throw new RestClientDefinitionException(\n                            annotationName + \" method \" + methodName + \" not found on \" + declaringClass);\n                }\n\n                if (paramValueMethod.parametersCount() == 0) {\n                    paramValue = methodCallCreator.invokeInterfaceMethod(paramValueMethod, interfaceMock);\n                } else if (paramValueMethod.parametersCount() == 1 && isString(paramValueMethod.parameterType(0))) {\n                    paramValue = methodCallCreator.invokeInterfaceMethod(paramValueMethod, interfaceMock,\n                            methodCallCreator.load(paramName));\n                } else {\n                    throw new RestClientDefinitionException(\n                            annotationName + \" method \" + declaringClass + \"#\" + methodName\n                                    + \" has too many parameters, at most one parameter, param name, expected\");\n                }\n\n            }\n\n            Type returnType = paramValueMethod.returnType();\n            ResultHandle valuesList;\n            if (isStringArray(returnType)) {\n                // repack array to list\n                valuesList = methodCallCreator.invokeStaticMethod(ARRAYS_AS_LIST, paramValue);\n            } else if (isString(returnType)) {\n                valuesList = methodCallCreator.newInstance(MethodDescriptor.ofConstructor(ArrayList.class));\n                methodCallCreator.invokeInterfaceMethod(LIST_ADD_METHOD, valuesList, paramValue);\n            } else {\n                throw new RestClientDefinitionException(\"Method \" + declaringClass.toString() + \"#\" + methodName\n                        + \" has an unsupported return type for \" + annotationName + \". \" +\n                        \"Only String and String[] return types are supported\");","sourceCodeStart":440,"sourceCodeEnd":476,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/resteasy-reactive/rest-client/deployment/src/main/java/io/quarkus/rest/client/reactive/deployment/MicroProfileRestClientEnricher.java#L440-L476","documentation":"Same constraint as the static-method variant but for interface-based value methods: when @ClientQueryParam/@ClientHeaderParam points to a method on an interface, the resolved method must have zero parameters or exactly one String parameter (the param name). Anything else fails client generation at build time.","triggerScenarios":"valueFrom interface method declared with 2+ parameters, or a single non-String parameter (e.g. int, URI), when the enricher generates the mock interface call.","commonSituations":"Interface evolved to add parameters (e.g. adding a config or context argument); build now fails for every client using that interface.","solutions":["Reduce the interface method to zero parameters or one String parameter","Overload: keep a rich method internally but expose a zero/String-arg method for the annotation","Use a static class-based valueFrom instead if more context is needed"],"exampleFix":"// before\ninterface Values { String token(String name, String scope); }\n// after\ninterface Values { String token(String name); }","handlingStrategy":"validation","validationCode":"for (Method m : Values.class.getDeclaredMethods()) {\n    if (m.getParameterCount() > 1 || (m.getParameterCount() == 1 && m.getParameterTypes()[0] != String.class))\n        throw new IllegalStateException(m + \" invalid signature for @ClientQueryParam valueFrom\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Document the allowed signature (0 args or 1 String) on provider interfaces","Add overload shims when evolving interfaces","Review interface changes with annotation usages in mind"],"tags":["rest-client","build-time","microprofile"],"backgroundTag":"rest-client-param-method-signature-invalid","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}