Repository navigation
issue #1729 - Binding query/path params and form fields to struct only works for explicit tags - #1734
Conversation
…elds that have explicit TAG defined on struct
Codecov Report
@@ Coverage Diff @@
## master #1734 +/- ##
==========================================
+ Coverage 85.87% 86.75% +0.87%
==========================================
Files 29 29
Lines 2018 2068 +50
==========================================
+ Hits 1733 1794 +61
+ Misses 180 175 -5
+ Partials 105 99 -6
Continue to review full report at Codecov.
|
|
As the semantics of binding already changed with v4 and we are about to restore what the users expect and will required documentation anyway we could also merge this. IMO it makes the usage very explicit and avoids unexpected pitfalls, but it diverges from the pre-4.11 behaviour. Some feedback would be greatly appreciated. |
|
This will certainly hit some people that have 'forgotten' to add tags and are using 'undocumented feature'. https://echo.labstack.com/guide/request only has examples with tags so we are changing undocumented 'feature' here - probably ok, no guarantees for undocumented features. This would avoid some errors also - binding to non tagged fields and failing with conversions This info could be added as a note to next 4.x release. github release page knows how to show markdown |
|
I'm still in favor of merging this and adjusting the documentation for the binder. It will prevent the autobinder from accidentally overwriting values from unexpected sources (like query params adding to the json body). It is still possible, just needs tagging in the structs used. Maybe @pafuent or @vishr have some more comments on that. The release notes for v4.2 will definitely include a section for the binder! |
Sorry to notice this later, but the benchmarks are broken after this change. BenchmarkBindbindData is not longer valid.
|
Thanks @aldas, great work. Docs will be updated soon to be ready for the next release. |
Binding query/path params and form fields to struct only works for fields that have explicit TAG defined on struct
This is for issue #1729 also read #1681 (comment) last part of binding serie (without docs pr)
Dunno if this should go to 4.x version.