-
Notifications
You must be signed in to change notification settings - Fork 101
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
64bit integer as json string #415
base: 3-10-stable
Are you sure you want to change the base?
64bit integer as json string #415
Conversation
@film42 how should we be controlling for proto3/proto2 in this scenario? while proto3 defines a json serialization format it would not be compat with what we are using for proto2, thoughts? |
@abrandoned which part would be incompatible with what's being used for proto2? Encoding 64 bit integers as strings, or omitting fields with default values? In #410 I preserved backwards compatibility by using the |
@abrandoned @film42 I have added a commit to preserve backwards compatibility with proto2 - the new serialisation behaviour is opt-in with Let me know what you think. |
Thanks for the contribution. We technically aren't supporting proto3 at this time, so having a proto3 flag seems a big strange. Would a flag like Btw, I'm not recommending changes, just asking for feedback. |
I guess the correct language would be like https://developers.google.com/protocol-buffers/docs/proto3#json_options |
This patch fixes incorrect encoding of 64 bit integers, which, according to the official protobuf docs must be encoded as a string.
It also removes fields that have the default value (such as
0
for numbers).