{"record":{"id":"d612e1d26753879b","repo":"quarkusio/quarkus","slug":"clientheaderparam-method-classname-methodnam","errorCode":null,"errorMessage":"@ClientHeaderParam method ${className}#${methodName} has too many parameters, at most one parameter, header name, expected","messagePattern":"@ClientHeaderParam method (.+?)#(.+?) has too many parameters, at most one parameter, header 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":908,"sourceCode":"                    if (accessibleType == AccessibleType.STATIC_METHOD) {\n                        supplier = new Supplier<ResultHandle>() {\n                            @Override\n                            public ResultHandle get() {\n\n                                if (headerFillingMethod.parametersCount() == 0) {\n                                    return fillHeader.invokeStaticMethod(headerFillingMethod);\n                                } else if (headerFillingMethod.parametersCount() == 1\n                                        && isString(headerFillingMethod.parameterType(0))) {\n                                    return fillHeader.invokeStaticMethod(headerFillingMethod, fillHeader.load(headerName));\n                                } else if (headerFillingMethod.parametersCount() == 1\n                                        && isComputedParamContext(headerFillingMethod.parameterType(0))) {\n                                    ResultHandle fillerParam = fillHeader\n                                            .newInstance(\n                                                    COMPUTER_PARAM_CONTEXT_IMPL_CTOR,\n                                                    fillHeader.load(headerName), requestContext);\n                                    return fillHeader.invokeStaticMethod(headerFillingMethod, fillerParam);\n                                } else {\n                                    throw new RestClientDefinitionException(\n                                            \"@ClientHeaderParam method \" + headerFillingMethod.declaringClass().toString() + \"#\"\n                                                    + headerFillingMethod.name()\n                                                    + \" has too many parameters, at most one parameter, header name, expected\");\n                                }\n\n                            }\n                        };\n                    } else if (accessibleType == AccessibleType.INTERFACE_METHOD) {\n                        supplier = new Supplier<ResultHandle>() {\n                            @Override\n                            public ResultHandle get() {\n\n                                String mockName = mockInterface(declaringClass, generatedClasses, index);\n                                ResultHandle interfaceMock = fillHeader.newInstance(MethodDescriptor.ofConstructor(mockName));\n\n                                if (headerFillingMethod.parametersCount() == 0) {\n                                    return fillHeader.invokeInterfaceMethod(headerFillingMethod, interfaceMock);\n                                } else if (headerFillingMethod.parametersCount() == 1","sourceCodeStart":890,"sourceCodeEnd":926,"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#L890-L926","documentation":"The static method resolved from @ClientHeaderParam (valueFrom) must take either zero parameters, a single String (header name), or a single HeaderFiller-compatible context parameter. When invoked statically and the method has more parameters than allowed, generation fails with this error.","triggerScenarios":"valueFrom static method declared with 2+ parameters or an unsupported single type (not String and not the compute context type), discovered while emitting bytecode that invokes it statically.","commonSituations":"Adding extra arguments (config, request id) to a header-fill helper; the Quarkus build fails for the whole app.","solutions":["Reduce the method to zero args, one String arg, or one HeaderFiller-style context arg","Wrap extra data in static state or a method-local lookup","Implement ComputeParameters/return String interface form if more context is genuinely needed"],"exampleFix":"// before\nstatic String token(String name, String env) { ... }\n// after\nstatic String token(String name) { ... }","handlingStrategy":"validation","validationCode":"for (Method m : HeaderUtils.class.getDeclaredMethods()) {\n    int n = m.getParameterCount();\n    if (n > 1 || (n == 1 && m.getParameterTypes()[0] != String.class))\n        throw new IllegalStateException(m + \" too many/unsupported parameters for @ClientHeaderParam\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Restrict header-fill methods to (String) or () signatures","Add signature checks to a build-time unit test","Keep auxiliary data in static configuration, not method parameters"],"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"}