{"record":{"id":"5399fcd942161cc1","repo":"quarkusio/quarkus","slug":"s-is-not-a-valid-path-parameter-in-the-path-s","errorCode":null,"errorMessage":"[%s] is not a valid path parameter in the path %s","messagePattern":"\\[(.+?)\\] is not a valid path parameter in the path (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions/websockets-next/runtime/src/main/java/io/quarkus/websockets/next/runtime/WebSocketConnectorBase.java","lineNumber":125,"sourceCode":"    }\n\n    public THIS addHeader(String name, String value) {\n        Objects.requireNonNull(name);\n        Objects.requireNonNull(value);\n        List<String> values = headers.get(name);\n        if (values == null) {\n            values = new ArrayList<>();\n            headers.put(name, values);\n        }\n        values.add(value);\n        return self();\n    }\n\n    public THIS pathParam(String name, String value) {\n        Objects.requireNonNull(name);\n        Objects.requireNonNull(value);\n        if (!pathParamNames.contains(name)) {\n            throw new IllegalArgumentException(\n                    String.format(\"[%s] is not a valid path parameter in the path %s\", name, path));\n        }\n        pathParams.put(name, value);\n        return self();\n    }\n\n    public THIS addSubprotocol(String value) {\n        subprotocols.add(Objects.requireNonNull(value));\n        return self();\n    }\n\n    public <VALUE> THIS userData(TypedKey<VALUE> key, VALUE value) {\n        userData.put(key.value(), value);\n        return self();\n    }\n\n    void setPath(String path) {\n        this.path = Objects.requireNonNull(path);","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/websockets-next/runtime/src/main/java/io/quarkus/websockets/next/runtime/WebSocketConnectorBase.java#L107-L143","documentation":"WebSocketConnectorBase.pathParam(String,String) only accepts parameter names that were declared as {placeholders} in the endpoint's @WebSocketClient path. If the name is not among the declared pathParamNames, this IllegalArgumentException is thrown, preventing silent mismatches between declared and supplied parameters.","triggerScenarios":"Calling connector.pathParam(\"id\", value) where \"id\" does not appear as {id} in the @WebSocketClient(path = ...) annotation — including typos, case mismatches, or passing a param for an endpoint whose path has no placeholders.","commonSituations":"Renaming the path in the annotation without updating connector code; copy-pasted connector code referencing another endpoint's parameter; typo in the parameter name string.","solutions":["Make the name passed to pathParam() match a {name} placeholder in the endpoint's path annotation exactly","Check the @WebSocketClient path for typos or renamed placeholders","Remove the pathParam() call if the path has no such placeholder"],"exampleFix":"// before\n@WebSocketClient(path = \"/chat/{roomId}\")\nconnector.pathParam(\"roomID\", \"42\");\n// after\nconnector.pathParam(\"roomId\", \"42\");","handlingStrategy":"validation","validationCode":"boolean isValidParam = endpointPath.contains(\"{\" + name + \"}\");\nif (!isValidParam) throw new IllegalArgumentException(name + \" not declared in path\");","typeGuard":null,"tryCatchPattern":"try {\n    connector.pathParam(name, value);\n} catch (IllegalArgumentException e) {\n    log.error(\"Path param {} not declared in endpoint path\", name, e);\n}","preventionTips":["Extract path placeholders into shared constants used by both annotation and connector code","Review @WebSocketClient path annotations when renaming params","Keep pathParam() calls adjacent to the endpoint class they configure"],"tags":["websockets","path-params","validation","client"],"backgroundTag":"invalid-path-parameter","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"}