-
-
Notifications
You must be signed in to change notification settings - Fork 2.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
Bug: wrong context ParamNames #1306
Comments
It seems like the first added path decides what the paramter-name is. If you add another handler to the same path, the parameter-names are re-used from the first handler. from context.go: (about line 130)
To me it seems that the parameter names are bound to the node across all http-mehtods. And this might just be correct behaviour. Do you really want different parameter-names for different http-methods? To support different parameter-names for different http-methods, the |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Any updates? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Any idea when this will be fixed? I feel this is a huge one, basically it makes it impossible to have the same routes for different methods and I end up having to create a different route for every method... |
As I understand the problem summary is something like this:
I'll try to provide draft PR in a few days |
Thanks @jerrdasur |
You can test your case against PR above. As for me, it solves the issue with a minimum of changes. |
@jerrdasur Thanks for support! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
So how the progress about this fix? It seems this PR request still unfinished and closed #1430 |
This is still a problem for us.. |
So this issue will be fixed in the v5 release? |
this is so stupid, and i hit it every couple of months. I have to google for it for 5 mins, and then the "oooh this one" moment comes. This violates the "don't do unexpected things" rule so hard. |
It will be addressed in Naming param differently for same path seems to be situation where you are thinking/using that param conceptionally differently in another method for same path - which seems really odd to me personally. I can not think situation where different names make sense. If it is conceptionally different thing - why do you use same path? Is it not confusing for API users? For example |
@aldas right answer: why it doesn't work properly so long time. |
Go vesion: latest
Echo version: latest
Code:
And requests:
The text was updated successfully, but these errors were encountered: