From b20b26d8d174a284481e31e49169e723e981d767 Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Thu, 23 Jul 2020 18:16:44 -0400 Subject: [PATCH] Disable automatic camelCasing in proto JSON (#6833) --- codec/json.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codec/json.go b/codec/json.go index eca4dc1207..cab6993cae 100644 --- a/codec/json.go +++ b/codec/json.go @@ -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