~bigbes/tarantool-protobuf: 76140b72

json: emit unbroken base64 for bytes fields ({nowrap = true})

Canonical proto3 JSON expects RFC 4648 unwrapped base64, but Tarantool's
`digest.base64_encode` defaults to RFC 2045 MIME-style 76-char line
wrapping. Any `bytes` payload past ~57 bytes used to land in the JSON
string with an embedded `\n`, which breaks every spec-compliant
consumer (grpc-gateway, protojson, protobuf-go's JSON, ...).

Pass `{nowrap = true}` at the two encode sites: the per-field bytes
encoder and the `google.protobuf.Any` opaque-fallback `value` encoder.

Surfaced by tarantool-etcd's `TestJSONGatewayBytesUnwrapped` over Range
responses whose `value` is >=57 bytes; its reference grpc-gateway never
emits the wrapped form.

Eugene Blikh <bigbes@gmail.com> — 2026-05-17 02:00:39 UTC

Commit 76140b72a95bd6de74a34a7db0d735c0fd6721e7view raw patch

Parent(s): 1bbd8f31

3 changed file(s)

FileStatus+
runtime/pb/json.lua M +2 -2
test/any_fieldmask_test.lua M +11
test/json_test.lua M +15