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?
When receiving a json object with number values and calling
context.BindJSON()(orcontext.Bind()), the numbers will be unmarshalled tofloat64values. If needed, this can be switched to unmarshalling intointby usingjson.Decoder.UseNumber(). However,BindJSON()doesn't give this control. This should be added somehow:...parameter