diff --git a/jsonpb.go b/jsonpb.go index 9dd66a2..d1b6eaa 100644 --- a/jsonpb.go +++ b/jsonpb.go @@ -153,6 +153,10 @@ func (c *jsonpbCodecV2) Marshal(d []byte, v interface{}, opts ...codec.Option) ( } } return marshalOptions.MarshalAppend(d[:0], m) + case codec.RawMessage: + return []byte(m), nil + case *codec.RawMessage: + return []byte(*m), nil default: return nil, codec.ErrInvalidMessage }