Schema Sample Data

Turn a schema into realistic test data. Deterministic, so the same schema always gives the same JSON and it can go straight into a fixture.

Everything is parsed and analysed entirely in your browser. Nothing you paste is ever uploaded to a server.

Deterministic, so it can go in a test

The same schema always produces exactly the same JSON here. That is the difference between sample data you can commit as a fixture and sample data you have to regenerate every time something changes. Nothing is random, and no external word list or fake-data corpus is used — the value chosen for a field comes from its declared type, its default if it has one, and a hint taken from its name.

Defaults win

A field with a declared default gets that exact value, because that is what a real reader would supply for it. Only fields without one get a generated value. A union picks its first non-null branch, since a sample full of nulls demonstrates nothing about the shape of your data — unless the field explicitly defaults to null, which is respected.

Protobuf JSON is not what most people expect

The canonical mapping renames fields to lowerCamelCase, encodes 64-bit integers as strings (they exceed what a JSON number represents exactly), writes enums as their symbol names rather than numbers, and represents Timestamp and Duration as strings rather than objects. The sample follows all of that, because a sample that looked like the .proto would be convenient and wrong.

Recursive schemas do not hang

A type that refers to itself — a tree node, a linked list — is legitimate and common. Generation stops when it revisits a type, so you get one level of the structure rather than an unresponsive page.

Checking a schema rather than filling it?

Use the Avro Schema Viewer, which validates defaults and logical types, or the Schema Compatibility Checker before you deploy a change.

Why is the output the same every time?

Deliberately. Random sample data cannot be committed to a test as a fixture, because the next run produces something different. The same schema always produces the same JSON here, so you can paste it straight into a test and it stays valid.

Does it respect my defaults?

Yes — a field with a declared default gets exactly that value rather than a generated one, since the default is what a real reader would supply. Fields without one get a value chosen to match the type, and where the field name hints at a shape such as email, url, uuid or city, the value follows that hint.

Why does my int64 come out as a string in the Protobuf output?

Because that is what protobuf's canonical JSON mapping specifies. 64-bit integers exceed what JSON numbers can represent exactly, so they are encoded as strings. The same mapping turns Timestamp and Duration into strings rather than objects, writes enums as their symbol names, and renames fields to lowerCamelCase — all of which surprise people the first time they see real protobuf JSON, which is why the sample shows it correctly rather than conveniently.

How does it handle a union or a nullable field?

It picks the first non-null branch, because a sample full of nulls demonstrates nothing about the shape of your data. If the field has an explicit null default, that is respected instead.

What about a schema that refers to itself?

Recursive types are common and legitimate — a tree node, a linked list. Sampling stops when it revisits a type rather than recursing forever, so you get one level of the structure instead of a hang.

Is my schema uploaded anywhere?

No. Parsing and generation both run in your browser.