-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Allow path params with conflicting names and different methods #2207
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
Allow path params with conflicting names and different methods #2207
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2207 +/- ##
==========================================
- Coverage 92.26% 92.11% -0.15%
==========================================
Files 37 37
Lines 3090 3019 -71
==========================================
- Hits 2851 2781 -70
+ Misses 150 147 -3
- Partials 89 91 +2
Continue to review full report at Codecov.
|
|
Sorry, but you copy my solution from #2208. I think, it's not good. Proof (force-push): https://github.com/labstack/echo/compare/81ceb2f7e4a38689693dadf79c5ce4c5ca2f46b4..459e309d2067f032d0984f05d718ad4b13b90b8c |
|
I'll check it soon but there seems to be little bit too few tests for huge change like that. I see 3 things here:
|
|
but this is cool PR as splitting single tree into tree for each method is thing that I have thought about trying out. Note: allow header can be sent for OPTIONS method and also for 405 (method not found) - I do not remember how good our tests cover all those things. Note: similar stuff in |
|
@ortyomka hello! |
|
@dmitrybarsukov and @ortyomka have you though of splitting these changes into multiple PRs. I do not think that changing method tree structure should be in same change as where from path parameters are taken at the end of routing. |
|
@aldas Original benchmarkmap of method to tree solutionAs you see, it has much more ns/op and >0 allocs/op. map in each node solutionCan you please re-review my PR again? |
|
@dmitrybarsukov I can doubt since my solution appeared 30 minutes later than your original one, and then after another 30 minutes your solution changes to a very similar one to mine. (similar checks, names) |
|
@aldas I will split my PR |
|
Note: support for different params names for same path is probably going to get merged way faster than tree changes. I engourage you to use |
|
@aldas |
Did you mean to create different PR's for my first solution (separate tree for each method) and second solution (where each node has map of method to handler with its own ppath and pnames) ? |
Closes issues #2201 and #1726
What was done: