avro-registry-4byte-schema-id

Status: IN

SchemaRegistry prepends a 4-byte big-endian unsigned int schema ID (struct.pack('>I', id)) to encoded payloads, modeling Confluent's Schema Registry wire format; schema IDs are limited to [0, 2^32).

Source: entries/2026/05/29/avro-serializer-avro_serializer.md

Example

header = struct.pack(">bI", 0, schema_id)  # magic byte + 4-byte schema ID
return header + encoded_data

JSON