Bind() Binds Body Param Instead of URL Param #2063
Unanswered
calvinsomething
asked this question in
Q&A
Replies: 1 comment 2 replies
-
This is from the echo guide:
So I guess what's happening is that the property is being rebound at the JSON binding stage? So the question is whether I can prevent this or do I have to manually bind the param. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
This isn't a big deal, I guess, but I don't like that it's happening. As per the example below, I am adding a param tag to the struct property for the struct I pass to
Bind()
.Bind()
correctly binds to struct... unless there is a conflicting parameter in the request body (well, I've only tested JSON). So even though I haven't tagged anything for json,Bind()
will still prefer json over the url param if the two params both have the same name...Is this working as intended? Is there a way around this? Seems unintuitive; maybe I'm missing something.
Thanks for any help.
Beta Was this translation helpful? Give feedback.
All reactions