Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting Only one parameter is allowed per path segment for valid route #59

Closed
cemoktra opened this issue Oct 10, 2024 · 4 comments
Closed

Comments

@cemoktra
Copy link

The following example should be a valid route with two parameters in two segments.

let mut router = matchit::Router::new();
let result = router.insert("cards/{cardReferenceToken}/authorizationholds/{authorizationHoldExternalReferenceId}:decrease", true);
match result {
    Ok(_) => {},
    Err(err) => panic!("That should work but ended in: {err}"),
}

For reference:
https://api.mambu.com/#cards-decreaseauthorizationhold

@ibraheemdev
Copy link
Owner

This is not yet supported, see #17. Though the panic message there should be better.

@cemoktra
Copy link
Author

any idea how to workaround this? i cannot change our whole backend away from axum now, but i need to support this case in the server code generator

@ibraheemdev
Copy link
Owner

For now you can parse the suffix manually from the {authorizationHoldExternalReferenceId} parameter.

@ibraheemdev
Copy link
Owner

Closing in favor of #17.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants