Skip to content

Comment on Context.Bind is confusing #2382

Description

@zzJinux

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions