-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an option to conform (fully) to the Protobuf 3 canonical JSON representation #76
Comments
Thanks for opening this issue, I think it would be a great improvement 👍 |
btw I started implementing this on the |
And I think support for serializing/deserializing |
Yeah DynamicMessages are definitely more "nice to have". Consistent handling of the more basic types is definitely more important. |
This recently bit me as well:
I ran into some JSON that was using both camelCased and snake_cased field names. I ended up having to hack in JsonFormat (essentially double parsing) to handle both. |
That should be handled with this option: Line 41 in 5d403ef
Did you have a case where that wasn't sufficient? |
To be clear, this was a case were the field names were both literal (snake_cased, in this instance) and camelCased (not literal). "someOne": {
"did_this": "for some reason"
} |
I'll try out |
|
int64, fixed64, uint64: JSON value will be a decimal string. Either numbers or strings are accepted.
If the Any contains a value that has a special JSON mapping, it will be converted as follows:
{"@type": xxx, "value": yyy}
. Otherwise, the value will be converted into a JSON object, and the"@type"
field will be inserted to indicate the actual data type.The text was updated successfully, but these errors were encountered: