add option to UseNumber() in gin.Context.BindJSON() #368
Closed
Description
When receiving a json object with number values and calling context.BindJSON()
(or context.Bind()
), the numbers will be unmarshalled to float64
values. If needed, this can be switched to unmarshalling into int
by using json.Decoder.UseNumber()
. However, BindJSON()
doesn't give this control. This should be added somehow:
- maybe a global switch, though this doesn't give per-request control.
- maybe an additional parameter or
...
parameter - any other idea?