This repository has been archived by the owner on Mar 2, 2022. It is now read-only.
Fix Echo's Bind
behaviour to use the more precise BindBody
#43
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previous versions of echo had an issue in which the
Bind
behaviour would be used generically for path params, query params and then body (in that order). What this means is that if you attempt to use echo'sContext.Bind
with a context that has either path or query params, it will use those, error early and never bind the JSON body. See labstack/echo#1356 for description.This becomes an issue for us with our SaaS product, which makes use of an auth middleware that introduces path params to routes that otherwise do not have them.
Luckily, this has been fixed in at least v4.2.1 via either struct tagging or
echo.DefaultBinder{}
'sBindBody
method. This PR simply bumps our dependency and introduces this use instead of the oldBind
:)Signed-off-by: Ben Marsden bmarsden10@gmail.com