Learn & troubleshoot

Protobuf guides for reading and debugging messages.

Short, practical guides for the moments when a protocol definition, a JSON object and a binary payload do not quite agree.

Read a Protobuf message from the first byte.

Start with a three-byte message and work out the field tag, wire type and integer value. Then see why strings, nested messages and packed arrays share the same outer wire type.

  • Field tags and varint encoding
  • Length-delimited fields
  • What a schema-free decoder can and cannot infer
Read the guide

Keep JSON conversions predictable.

JSON has fewer numeric types than Protobuf. Learn when to use strings, how bytes become Base64 and why a oneof can contain only one value. The guide also explains how this workspace differs from the canonical ProtoJSON format.

  • 64-bit integers without precision loss
  • Enums, bytes and map keys
  • Field naming and oneof presence
Read the guide

Diagnose errors in a useful order.

A malformed Base64 string, a framed transport message and the wrong schema are different problems. Work from representation to message boundaries to field definitions, rather than changing random fields until decoding succeeds.

  • Validate Hex and Base64
  • Check framing and compression
  • Resolve schema imports and message types
Read the guide