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

How to nest route with path param? #876

Open
nacardin opened this issue Sep 3, 2024 · 1 comment
Open

How to nest route with path param? #876

nacardin opened this issue Sep 3, 2024 · 1 comment

Comments

@nacardin
Copy link

nacardin commented Sep 3, 2024

I would like to define a path param to be used in endpoints across a nested route.

let nested_resource_route = Route::new();

Route::new()
  .nest(":my_param/resource", nested_resource_route)

This panics with "captures are not allowed in the nest path".

Why are path params not allowed in nested routes?

Is there a way to achieve this with .at instead of .nest, what is the difference between these methods?

Thanks!

@sunli829
Copy link
Collaborator

Poem's nested routes currently do not support parameterized paths, but I will improve this later.

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