To represent an array or list of items, use the repeated keyword. These fields can contain zero or more elements of the specified type.
In modern Protobuf, repeated scalar numeric fields (like int32, float, etc.) are "packed" by default. Instead of repeating the field tag for every element, they are stored as one single block with a length prefix. That saves a tag per element on large arrays.
All four values share one entry for the field. Add more numbers and watch only the payload grow.
schema.proto
edition = "2024"; package demo.v1; message Batch { repeated int32 ids = 1; repeated string tags = 2; }
Input JSON (editable)
ProtoJSON
Compiling the schema...
Next
Maps
Protobuf map fields: which key and value types are allowed, the rules that constrain them, and how maps are really repeated entries underneath.