Disable automatic camelCasing in proto JSON (#6833)

This commit is contained in:
Aaron Craelius 2020-07-23 18:16:44 -04:00 committed by GitHub
parent 0a498d8c18
commit b20b26d8d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -12,7 +12,7 @@ import (
// ProtoMarshalJSON provides an auxiliary function to return Proto3 JSON encoded
// bytes of a message.
func ProtoMarshalJSON(msg proto.Message) ([]byte, error) {
jm := &jsonpb.Marshaler{EmitDefaults: false, OrigName: false}
jm := &jsonpb.Marshaler{OrigName: true}
err := types.UnpackInterfaces(msg, types.ProtoJSONPacker{JSONPBMarshaler: jm})
if err != nil {
return nil, err