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

Comment on Context.Bind is confusing #2382

Open
3 tasks done
zzJinux opened this issue Jan 26, 2023 · 0 comments
Open
3 tasks done

Comment on Context.Bind is confusing #2382

zzJinux opened this issue Jan 26, 2023 · 0 comments

Comments

@zzJinux
Copy link

zzJinux commented Jan 26, 2023

Issue Description

Comment on Context.Bind says: "Bind binds the request body into..."

echo/context.go

Lines 103 to 105 in f36d566

// Bind binds the request body into provided type `i`. The default binder
// does it based on Content-Type header.
Bind(i interface{}) error

... while DefaultBinder.Bind says another: "Binding is done in following order: 1) ... 2) ... 3) ...

echo/bind.go

Lines 107 to 110 in f36d566

// Bind implements the `Binder#Bind` function.
// Binding is done in following order: 1) path params; 2) query params; 3) request body. Each step COULD override previous
// step binded values. For single source binding use their own methods BindBody, BindQueryParams, BindPathParams.
func (b *DefaultBinder) Bind(i interface{}, c Context) (err error) {

I think the comment on Context.Bind is the one that requires correction, am I right?

Checklist

  • Dependencies installed
  • No typos
  • Searched existing issues and docs

Version/commit

v4.10.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant