{"record":{"id":"609431fbbd8b973e","repo":"quarkusio/quarkus","slug":"path-parameter-not-provided","errorCode":null,"errorMessage":"Path parameter not provided ","messagePattern":"Path parameter not provided ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/jaxrs/UriBuilderImpl.java","lineNumber":635,"sourceCode":"\n    protected StringBuilder replaceParameter(Map<String, ? extends Object> paramMap, boolean fromEncodedMap, boolean isTemplate,\n            String string, StringBuilder builder, boolean encode, boolean encodeSlash) {\n        if (string.indexOf('{') == -1) {\n            return builder.append(string);\n        }\n        Matcher matcher = createUriParamMatcher(string);\n        int start = 0;\n        while (matcher.find()) {\n            builder.append(string, start, matcher.start());\n            String param = matcher.group(1);\n            boolean containsValueForParam = paramMap.containsKey(param);\n            if (!containsValueForParam) {\n                if (isTemplate) {\n                    builder.append(matcher.group());\n                    start = matcher.end();\n                    continue;\n                }\n                throw new IllegalArgumentException(\"Path parameter not provided \" + param);\n            }\n            Object value = paramMap.get(param);\n            String stringValue = value != null ? value.toString() : null;\n            if (stringValue == null) {\n                throw new IllegalArgumentException(\"Template parameter null: \" + param);\n            }\n\n            if (encode) {\n                if (!fromEncodedMap) {\n                    if (encodeSlash)\n                        stringValue = Encode.encodePathSegmentAsIs(stringValue);\n                    else\n                        stringValue = Encode.encodePathAsIs(stringValue);\n                } else {\n                    if (encodeSlash)\n                        stringValue = Encode.encodePathSegmentSaveEncodings(stringValue);\n                    else\n                        stringValue = Encode.encodePathSaveEncodings(stringValue);","sourceCodeStart":617,"sourceCodeEnd":653,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/jaxrs/UriBuilderImpl.java#L617-L653","documentation":"IllegalArgumentException from replaceParameter when a {template} placeholder in the URI template has no entry (or only a null entry) in the parameter map, and the build is not a template-mode build. JAX-RS requires every URI template parameter to be resolved before build(); leaving one unresolved would produce a literal '{name}' in the URI, which is invalid for a concrete URI.","triggerScenarios":"UriBuilder.build(Map) / buildFromMap / buildString path where the map is missing a key named by a placeholder in the template, or the key exists but maps to null (that exact case reports 'Path parameter not provided' when containsValueForParam is false because null is not 'contained').","commonSituations":"Renaming a path variable in @Path(\"/{id}\") without updating the map keys; typos in map keys (case mismatch); conditional parameters that are sometimes absent; refactoring from varargs build(...) to build(Map) with wrong keys.","solutions":["Ensure the map contains a non-null entry for every {placeholder} in the template; print the template and the map keys to diff them","Match key names exactly, including case, with the placeholder names","If a parameter is genuinely optional, build the template conditionally or use build(Object...) with ordered values, or keep the placeholder by building a template URI instead of a concrete one","Add a unit test that builds every client URI template with a complete parameter map"],"exampleFix":"// before\nURI u = UriBuilder.fromUri(\"/users/{id}/orders/{orderId}\").build(Map.of(\"id\", 7)); // orderId missing\n// after\nURI u = UriBuilder.fromUri(\"/users/{id}/orders/{orderId}\").build(Map.of(\"id\", 7, \"orderId\", 42));","handlingStrategy":"validation","validationCode":"Set<String> required = extractPlaceholders(template); // regex \\{([^}]+)\\}\nSet<String> missing = new HashSet<>(required);\nmissing.removeAll(paramMap.keySet());\nif (!missing.isEmpty()) throw new IllegalArgumentException(\"Missing URI template params: \" + missing);","typeGuard":"static boolean hasAllParams(String template, Map<String, ?> params) {\n    java.util.regex.Matcher m = java.util.regex.Pattern.compile(\"\\\\{([^}]+)\\\\}\").matcher(template);\n    while (m.find()) { if (!params.containsKey(m.group(1)) || params.get(m.group(1)) == null) return false; }\n    return true;\n}","tryCatchPattern":"try {\n    URI uri = builder.build(params);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"Path parameter not provided\")) {\n        throw new IllegalStateException(\"Template param missing for \" + builder.toTemplate() + \": \" + e.getMessage(), e);\n    }\n    throw e;\n}","preventionTips":["Keep template placeholders and map keys in one constant/enum to avoid typos","Write a test asserting each client method supplies all placeholders of its template","Prefer named map-based build over positional varargs when there are 2+ parameters"],"tags":["uri","resteasy-reactive","missing-parameter"],"backgroundTag":"missing-uri-template-parameter","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}