JSON Proto changes

This commit is contained in:
Aleksandr Bezobchuk
2020-03-26 12:46:10 -04:00
parent e4857898c0
commit 6135912e53
20 changed files with 868 additions and 112 deletions
+1 -8
View File
@@ -95,14 +95,7 @@ func (pc *ProtoCodec) MarshalJSON(o interface{}) ([]byte, error) { // nolint: st
return nil, fmt.Errorf("cannot protobuf JSON encode unsupported type: %T", o)
}
buf := new(bytes.Buffer)
marshaler := &jsonpb.Marshaler{}
if err := marshaler.Marshal(buf, m); err != nil {
return nil, err
}
return buf.Bytes(), nil
return ProtoMarshalJSON(m)
}
func (pc *ProtoCodec) MustMarshalJSON(o interface{}) []byte {