DioxusLabs/dioxus · error

expected path param to be wrapped in curly braces

Error message

expected path param to be wrapped in curly braces

What it means

A path segment looked like a capture (it starts with '{') but did not end with '}', so the macro cannot extract the parameter name. Captured path params must be fully wrapped in curly braces, e.g. {id}.

Solutions

  1. Wrap the path parameter name in curly braces, e.g. "/users/{id}".
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/fullstack-macro/src/lib.rs:1109 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of DioxusLabs/dioxus@24f6a829df (2026-08-23). Data as JSON: /api/errors/cd6a5679c80117f6. Report an issue: GitHub.

Appendix: source

Thrown at packages/fullstack-macro/src/lib.rs:1109

        matches!(self, Self::Capture(..) | Self::WildCard(..))
    }

    fn capture(&self) -> Option<(&Ident, &Type)> {
        match self {
            Self::Capture(_, _, ident, ty, _) => Some((ident, ty)),
            Self::WildCard(_, _, _, ident, ty, _) => Some((ident, ty)),
            _ => None,
        }
    }

    fn new(str: &str, span: Span, ty: Box<Type>) -> syn::Result<Self> {
        let ok = if str.starts_with('{') {
            let str = str
                .strip_prefix('{')
                .unwrap()
                .strip_suffix('}')
                .ok_or_else(|| {
                    syn::Error::new(span, "expected path param to be wrapped in curly braces")
                })?;
            Self::Capture(
                LitStr::new(str, span),
                Brace(span),
                Ident::new(str, span),
                ty,
                Brace(span),
            )
        } else if str.starts_with('*') && str.len() > 1 {
            let str = str.strip_prefix('*').unwrap();
            Self::WildCard(
                LitStr::new(str, span),
                Brace(span),
                Star(span),
                Ident::new(str, span),
                ty,
                Brace(span),
            )

View on GitHub (pinned to 24f6a829df)