{"record":{"id":"9dae2ad67f0ebff9","repo":"quarkusio/quarkus","slug":"missing-required-param-in-method-method","errorCode":null,"errorMessage":"Missing required param in method '<method>'","messagePattern":"Missing required param in method '<method>'","errorType":"http","errorClass":"WebApplicationException","httpStatus":400,"severity":"error","filePath":"extensions/spring-web/resteasy-reactive/runtime/src/main/java/io/quarkus/spring/web/resteasy/reactive/runtime/SpringRequestParamHandler.java","lineNumber":32,"sourceCode":"import org.jboss.resteasy.reactive.server.spi.ServerRestHandler;\n\n/**\n * In Spring, parameters annotated with {@code @RequestParam} are required by default unless explicitly marked as\n * optional.\n * This {@link SpringRequestParamHandler} enforces the required constraint responding with a BAD_REQUEST status.\n *\n */\npublic class SpringRequestParamHandler implements HandlerChainCustomizer {\n    @Override\n    public List<ServerRestHandler> handlers(HandlerChainCustomizer.Phase phase, ResourceClass resourceClass,\n            ServerResourceMethod resourceMethod) {\n        if (phase == Phase.RESOLVE_METHOD_PARAMETERS) {\n            return Collections.singletonList(new ServerRestHandler() {\n                @Override\n                public void handle(ResteasyReactiveRequestContext requestContext) throws Exception {\n                    Map<String, List<String>> parametersMap = requestContext.serverRequest().getQueryParamsMap();\n                    if (parametersMap.isEmpty()) {\n                        throw new WebApplicationException(\"Missing required param in method '\" + resourceMethod.getName() + \"'\",\n                                Response.Status.BAD_REQUEST);\n                    }\n                }\n            });\n        }\n        return Collections.emptyList();\n    }\n\n}\n","sourceCodeStart":14,"sourceCodeEnd":42,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/spring-web/resteasy-reactive/runtime/src/main/java/io/quarkus/spring/web/resteasy/reactive/runtime/SpringRequestParamHandler.java#L14-L42","documentation":"SpringWebRequestParamHandler is a RESTEasy Reactive request filter installed when Spring-style required request parameter enforcement is active. In RESOLVE_METHOD_PARAMETERS phase it checks the query parameter map; if it is empty while the resource method declares required params, it throws a 400 Bad Request WebApplicationException naming the resource method.","triggerScenarios":"Calling a resource method that declares required @RequestParam entries (via the Spring param handler) without sending any query parameters on the request.","commonSituations":"Clients omitting query strings (e.g. a bookmarked URL without params); API consumers hitting the endpoint directly; missing client-side query building.","solutions":["Send the required query parameters, e.g. GET /endpoint?name=value.","Mark the Spring @RequestParam as required = false and supply a defaultValue if the param is genuinely optional.","Fix the client code or proxy/gateway that strips the query string."],"exampleFix":"// before (client)\nGET /search\n\n// after\nGET /search?q=quarkus\n\n// or relax the param: before @RequestParam String q\n// after @RequestParam(required = false, defaultValue = \"\") String q","handlingStrategy":"try-catch","validationCode":"// client-side pre-check before calling the endpoint\nif (!url.includes('?') || new URLSearchParams(url.split('?')[1]).size === 0) {\n  throw new Error('required query params missing for ' + endpoint);\n}","typeGuard":null,"tryCatchPattern":"try {\n  Response r = client.send(req);\n} catch (WebApplicationException e) {\n  if (e.getResponse().getStatus() == 400) {\n    // fix request: append required query parameters\n  } else throw e;\n}","preventionTips":["Document required query params in OpenAPI annotations so clients generate them.","Add client-side contract tests asserting the query string is present.","Use required=false + defaultValue only when the param is truly optional."],"tags":["quarkus","resteasy-reactive","spring-web","bad-request","request-params"],"backgroundTag":"missing-required-argument","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}