Skip to content

Regression: binding a map is not allowed anymore #988

Closed
@jinroh

Description

@jinroh

Issue Description

I think a valid use case of binding to a map[string]interface{} now causes the following error: Binding element must be a struct. I think the regression has been caused by #972.

Is this use case still valid ?

Checklist

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

Expected behaviour

Binding a map[string]interface{} is valid.

Actual behaviour

Binding a map[string]interface{} causes an error.

Code to debug

package main

func handler(c echo.Context) {
  var m map[string]interface{}
  if err := c.Bind(&m); err != nil {
    // err is "Binding element must be a struct"
  }
  return nil
}

Version/commit

1e9845a

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions