diff --git a/encoding/protobuf/jsonpb/decoder.go b/encoding/protobuf/jsonpb/decoder.go index 2ecba4954..af6e25bf4 100644 --- a/encoding/protobuf/jsonpb/decoder.go +++ b/encoding/protobuf/jsonpb/decoder.go @@ -209,7 +209,7 @@ func (r *rewriter) rewrite(schema cue.Value, expr ast.Expr) (x ast.Expr) { case cue.BytesKind: x, q, str := stringValue(expr) - if x == nil && q.IsDouble() { + if x == nil { break } diff --git a/encoding/protobuf/jsonpb/testdata/decoder/bytes_nonstring.txtar b/encoding/protobuf/jsonpb/testdata/decoder/bytes_nonstring.txtar new file mode 100644 index 000000000..8c8660422 --- /dev/null +++ b/encoding/protobuf/jsonpb/testdata/decoder/bytes_nonstring.txtar @@ -0,0 +1,6 @@ +-- schema.cue -- +b: [string]: bytes +-- int.cue -- +b: field: 42 +-- out/jsonpb/int.cue -- +b: field: 42