-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
fix bind with map[string]interface{} for json post but with no params #989
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #989 +/- ##
=======================================
Coverage 76.56% 76.56%
=======================================
Files 27 27
Lines 2232 2232
=======================================
Hits 1709 1709
Misses 400 400
Partials 123 123
Continue to review full report at Codecov.
|
@goenning can you review this change? |
@vishr LGTM, |
@goenning A request similar request with params will fail. This change has introduced new bugs recently, do you think this can be handled in a custom binder? |
@goenning I understand this PR will fix it, however, I could see a request with params binding to a map will fail. e.g. Path: {
"name": "John Snow"
} |
@vishr I see there's a new check I get your point, there could be more unforeseen binding issues. But still, I'd vote for keeping it. I've upgrade to the latest commit and had no issues because all my scenarios are binding to a struct, not slices/maps. But such cases are now covered by unit tests. |
@wonderflow I have reverted this change, things should work fine now. |
yes, I have tested, it's ok now, thanks |
hello, I hope to handle a post request with no params, but the binddata failed me.
bind data will check type as struct, I hope to decode use map[string]interface{}
hope to be merged.