You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is impossible to serialize structs into JSON objects with keys containing certain characters, most notably commas (in contrast with all other ASCII punctuation, because they are used to separate key name from tag options). This could be corrected by interpreting escape sequences in the tags as if they were double-quoted strings, which is possible since backslash characters are reserved.
What version of Go are you using (go version)? go version go1.5.1 linux/amd64
What operating system and processor architecture are you using (go env)?
While it's probably not seen in the wild, I ran into this while trying to be thorough in testing. And even though the impact is low, having the mapping from struct tag to JSON key be non-surjective does seem unnecessarily flawed.
It is impossible to serialize structs into JSON objects with keys containing certain characters, most notably commas (in contrast with all other ASCII punctuation, because they are used to separate key name from tag options). This could be corrected by interpreting escape sequences in the tags as if they were double-quoted strings, which is possible since backslash characters are reserved.
go version
)?go version go1.5.1 linux/amd64
go env
)?Attempted to serialize a struct into a JSON object with fields containing commas: http://play.golang.org/p/2KgYUahN8a
The text was updated successfully, but these errors were encountered: