-
- Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Description
Issue Description
Breaking change on v4.12.0:
The c.Bind is now mapping query params & request body to list of string.
Example:
POST /test?query=param
request body
{"field1": "somevalue"}The code
request := make(map[string]interface{}) if err := c.Bind(&request); err != nil { return err } fmt.Printf("%#v", request)Previous behaviour (pre v4.12.0):
Result: map[string]interface {}{"query":"param", "field1":"somevalue"}
Current behaviour (v4.12.0):
Result: map[string]interface {}{"query":[]string{"param"}, "field1":[]string{"somevalue"}}
Checklist
- Dependencies installed
- No typos
- Searched existing issues and docs
Expected behaviour
The behaviour from the code above should keep on returning non-breaking change and still return this on the newest version:
Result: map[string]interface {}{"query":"param", "field1":"somevalue"}
Actual behaviour
In v4.12.0, the result from the code above returned different result:
Result: map[string]interface {}{"query":[]string{"param"}, "field1":[]string{"somevalue"}}
Steps to reproduce
Working code to debug
package main func main() { }Version/commit
v4.12.0
Metadata
Metadata
Assignees
Labels
No labels