-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Dynamic matching / static matching - expected behaviour #1858
Comments
We should document route matching and make sure we have tests for both, to start. How do you think this should work? |
I've personally been avoiding declaring two routes like this and |
I'd have expect it to work the way you just said: matching happening first on the most specific param, and then on the wildcard matcher, regardless of order of declaration |
I think it's not that easy, for example, |
Well, I was thinking it should probably match the path from left to right. Hence if both |
I wouldn't be so sure. Matching "whichever matches first" is also a fine strategy. Either way what this is saying is that the matching mechanism should probably be something I can choose. |
I might play with the config and write some specs in which you can choose the matching behaviour then when I get to it 👍 |
This came up again in #2350, cc: @glebsonik. |
Before adding new matching strategies, let's better document the order of matching we have today. I would add |
When trying to have an endpoint that matches dynamically except for specific keywords.
i.e.
GET resource/:id
=> returns the resourceGET resource/new
=> returns a JSON schema of the resourceThe issue is that when I define it this way:
I will never hit the
resource/new
endpoint. However, if I define it the other way around, it will work.The text was updated successfully, but these errors were encountered: