Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

To quote one of the maintainers of the golang/protobuf implementation:

> The jsonpb package is intended to the be faithful implementation of the proto<->JSON specification, for which the C++ implementation is considered the canonical "reference" implementation.

And that C++ implementation does some kinda dumb things. For example, it marshals the protobuf type of int64 into a string when marshaling from a protobuf struct into JSON.

https://github.com/golang/protobuf/pull/916

I believe that the package they mention there is meant to be a more "canonical" protobuf <-> json marshaller than the existing jsonpb package.



IMO marshaling int64 to string is required for interoperability; RFC7159 recommends not assuming that more than IEEE754's 53 bits of integer precision are available:

https://tools.ietf.org/html/rfc7159#section-6




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: