Current implementation of json decoder (1.7) requires numbers be integers or strings only if string tag specified. Most web oriented languages (php for example) has no difference between types, so json produced by them can contain integers/floats/booleans as strings.
I suggest to create new tag which permits numbers as strings and ints at same time.
Example:
struct {
Xint`json:"x,maystring"`
}
Can be unmarshalled from {"x":"1234"} and {"x":1234}
The text was updated successfully, but these errors were encountered:
Current implementation of json decoder (1.7) requires numbers be integers or strings only if string tag specified. Most web oriented languages (php for example) has no difference between types, so json produced by them can contain integers/floats/booleans as strings.
I suggest to create new tag which permits numbers as strings and ints at same time.
Example:
Can be unmarshalled from
{"x":"1234"}
and{"x":1234}
The text was updated successfully, but these errors were encountered: