{"record":{"id":"d708654a384b28fd","repo":"DioxusLabs/dioxus","slug":"wildcard-path-param-must-be-the-last-path-param","errorCode":null,"errorMessage":"wildcard path param must be the last path param","messagePattern":"wildcard path param must be the last path param","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/fullstack-macro/src/lib.rs","lineNumber":1004,"sourceCode":"            return Err(syn::Error::new(span, \"expected path to start with '/'\"));\n        }\n        let path = path.strip_prefix('/').unwrap();\n\n        let mut path_params = Vec::new();\n\n        for path_param in path.split('/') {\n            path_params.push((\n                Slash(span),\n                PathParam::new(path_param, span, Box::new(parse_quote!(())))?,\n            ));\n        }\n\n        let path_param_len = path_params.len();\n        for (i, (_slash, path_param)) in path_params.iter().enumerate() {\n            match path_param {\n                PathParam::WildCard(_, _, _, _, _, _) => {\n                    if i != path_param_len - 1 {\n                        return Err(syn::Error::new(\n                            span,\n                            \"wildcard path param must be the last path param\",\n                        ));\n                    }\n                }\n                PathParam::Capture(_, _, _, _, _) => (),\n                PathParam::Static(lit) => {\n                    if lit.value() == \"*\" && i != path_param_len - 1 {\n                        return Err(syn::Error::new(\n                            span,\n                            \"wildcard path param must be the last path param\",\n                        ));\n                    }\n                }\n            }\n        }\n\n        let mut query_params = Vec::new();","sourceCodeStart":986,"sourceCodeEnd":1022,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/24f6a829df0dfa203961a98ea4cae21c2ff27e28/packages/fullstack-macro/src/lib.rs#L986-L1022","documentation":"`RouteParser::new` validates each path param and errors if a wildcard (`:..name` catch-all) segment appears anywhere except the final position. Since a catch-all consumes all remaining segments, any segment after it could never match, so the route is rejected at compile time.","triggerScenarios":"Thrown at packages/fullstack-macro/src/lib.rs:1004 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Move the wildcard (catch-all) path parameter to the end of the route; no path params may follow it."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"24f6a829df0dfa203961a98ea4cae21c2ff27e28","analyzedAt":"2026-08-23T07:10:14.078Z","contentChangedAt":"2026-08-23T07:10:14.078Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}