Closed ebelevics closed 2 years ago
The reason you're having trouble is that /todos/filter
is matching the regular expression for :id
and filter
. If you'd like to make the pattern for :id
more restrictive, you shouldn't have that problem, e.g. :id(/d+)
. You can see the path_to_regexp docs for more details (GR uses path_to_regexp to implement it's path parsing).
Here is small example that causes this issue. I have three routes /todos, /todos/:id, /todos/filters. Why when I go to "/todos/filters" it drops me this exception? P.S. When I think more about it -> it's because "filters" is expected as :id? Shouldn't router use parameter in subroutes as last resort, giving higher priority to static addresses first?