Skip to content
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

feat(binding): add DisallowUnknownFields() in gin.Context.BindJSON() #2028

Merged
merged 3 commits into from Sep 6, 2019
Merged

feat(binding): add DisallowUnknownFields() in gin.Context.BindJSON() #2028

merged 3 commits into from Sep 6, 2019

Conversation

kszafran
Copy link
Contributor

This pull requests adds the option to enable DisallowUnknownFields on the JSON decoder, similarly to how enabling UseNumber works.

@kszafran
Copy link
Contributor Author

@thinkerou Let me know if I should do something about this PR.

@appleboy appleboy added this to the 1.5 milestone Sep 3, 2019
@codecov
Copy link

codecov bot commented Sep 3, 2019

Codecov Report

Merging #2028 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2028      +/-   ##
==========================================
+ Coverage   98.69%   98.69%   +<.01%     
==========================================
  Files          40       40              
  Lines        2225     2229       +4     
==========================================
+ Hits         2196     2200       +4     
  Misses         16       16              
  Partials       13       13
Impacted Files Coverage Δ
mode.go 91.66% <100%> (+0.75%) ⬆️
binding/json.go 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b80d675...b61165e. Read the comment docs.

@thinkerou thinkerou merged commit f38c30a into gin-gonic:master Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants