On Monday, 18 July 2016 18:25:41 UTC+1, Shashwat Agarwal wrote: > > I was looking at this document: > https://developers.google.com/protocol-buffers/docs/proto3#json and > noticed that int64, fixed64, uint64 are mapped to string when converting to > JSON. Any specific reason why this is done? This deviation breaks a lot of > other JSON parsers and any code in JS that relies on the fact that *int64 > are numbers rather than string. >
It's due to the way that all numbers in JSON are basically IEEE-754 64-bit doubles... which means that any 64-bit integers can lose information. Using a string instead, all 64-bit integers can be round-tripped with no loss of information. Jon -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscr...@googlegroups.com. To post to this group, send email to email@example.com. Visit this group at https://groups.google.com/group/protobuf. For more options, visit https://groups.google.com/d/optout.