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
protobuf3 default JSON encoding #44
Comments
The newly added jsonpb package (see 67cbcad) is the official vehicle for JSON support. There's not yet any support for Timestamp and friends yet. |
Thank you for the update! |
Using jsonpb [1,2]. Drop the proto.String bits to avoid errors like: ./example.go:17: cannot use proto.String("linux") (type *string) as type string in field value And use a reference to s to avoid: ./example.go:29: cannot use s (type oci.LinuxSpec) as type proto.Message in argument to marshaler.Marshal: oci.LinuxSpec does not implement proto.Message (ProtoMessage method has pointer receiver) [1]: golang/protobuf#44 [2]: http://godoc.org/github.com/golang/protobuf/jsonpb Signed-off-by: W. Trevor King <wking@tremily.us>
Using jsonpb [1,2]. Drop the proto.String bits to avoid errors like: ./example.go:17: cannot use proto.String("linux") (type *string) as type string in field value And use a reference to s to avoid: ./example.go:29: cannot use s (type oci.LinuxSpec) as type proto.Message in argument to marshaler.Marshal: oci.LinuxSpec does not implement proto.Message (ProtoMessage method has pointer receiver) [1]: golang/protobuf#44 [2]: http://godoc.org/github.com/golang/protobuf/jsonpb Signed-off-by: W. Trevor King <wking@tremily.us>
553c764 adds |
c6184d3 adds |
552c7b9 adds I think that's all we have covered right now. |
In the proto3 there are encodings for different types, in particular the Timestamp type. Where is that code implemented? I am having a hard time figuring it out. https://developers.google.com/protocol-buffers/docs/proto3#json
cc @sym3tri
The text was updated successfully, but these errors were encountered: