SaaS user payload
A user from an admin API: a UUID, an address, a role, a plan object, scopes, and a last login that is null until it happens.
Pikkola Data Studio, tool No. 45
One payload in, five written shapes out: JSON Schema, TypeScript, Zod, a Go struct and a Python TypedDict. Then the other direction, which is where schemas usually break: a schema on one side, a test payload on the other, and every value that fails named by its path.
The four tabs
Every tab shares one shape and one set of options. No account, no size limit worth worrying about, and nothing leaves the tab.
Paste one object, or an array of rows. Keys that appear in every row stay required, keys that some rows leave out become optional, and a value that is null in one row and a string in another becomes a union of the two.
0 keys
A format is read from the value itself. The name of the key is never used, so a key called email holding 42 is a number.
The usual way to break a contract is to write a schema nobody ever ran. Put one here with a payload that should pass, and with one that should not, and the failing values are named by path.
ready
Each one is shaped the way the real thing arrives: a nested object, an array of objects, an empty array, a null that is not a string, a date, an address, a number that is not a count. Load one and the studio fills with it.
A user from an admin API: a UUID, an address, a role, a plan object, scopes, and a last login that is null until it happens.
An order with a customer, an address, an array of line items, totals, and an empty refunds array that says nothing about what a refund looks like.
A delivery event: an envelope around a data object, a unix timestamp, attempts with two different status codes, and a customer that is null.
A gateway config: nested server and database blocks, a connection URL, feature flags as booleans, and a maintenance window that is null.
These change how the same shape is written, not what it means. The output redraws as soon as one changes.
Options live in this browser, next to the text you typed. Nothing is sent anywhere.
How it reads
Inference is a description of what was seen, not a promise about what will arrive. Knowing where the difference bites is the whole job.
01
One object marks every key it holds as required, because it is the only evidence there is. An array of rows is better evidence: a key that two rows carry and one does not becomes optional, and the JSON Schema required list shrinks to the keys that never went missing.
02
An email, a UUID, an ISO timestamp and an https address are recognised by their shape, not by the name of the key holding them. That is why a key called created_at with the number 42 comes out as an integer, and why a plain string that looks like neither stays a plain string.
03
An empty array is an array of unknown, and a null is a null until a second value contradicts it. Paste a row that has an item in the array and a string in the nullable field, and both fill in. No tool can invent the shape of a thing it has never seen.
| Output | Written as | Where it goes |
|---|---|---|
| JSON Schema | properties, required, format | Contract files, API docs, ajv and every other validator |
| TypeScript | interface, optional members | Front end types, SDK shapes, typed fetch results |
| Zod | z.object, .email(), .nullable() | Runtime parsing at the edge of a request |
| Go | struct with json tags | Services that decode the same payload |
| Python | TypedDict, NotRequired | Scripts, notebooks, a typed client |
No. One row describes one case. Any property that appears in that row is marked required, so a second row with a missing key would fail the schema the first row produced. Paste several rows as an array and the keys missing from some of them become optional, which is the closest a sample can come to the truth.
They are read from the values, not from the key names. A string that parses as an ISO 8601 timestamp gets format date-time, one shaped like an address gets email, one shaped like a UUID gets uuid, and one starting with http:// or https:// gets uri. A key called created_at holding 42 is still a number, and the writer says so.
It decides whether a key the schema does not describe is allowed. Left open, a payload may carry extra keys and still pass. Closed, the validator names each unknown key by path and the JSON Schema output carries additionalProperties false at every object level. The Options tab switches it for all five writers at once.
Each error names the value that failed, as a path from the root such as $.items[1].quantity, and the keyword that failed. The rest of the document is still checked, so one run lists every problem instead of stopping at the first one.
type, required, properties, items, additionalProperties, enum, const, minimum and maximum, exclusiveMinimum and exclusiveMaximum, multipleOf, minLength, maxLength, pattern, format, minItems, maxItems, anyOf, oneOf, allOf, not and local $ref. Remote $ref, unevaluatedProperties and dependentSchemas are not followed, and format is enforced as a check rather than left as an annotation.
No. The inference and the validation both run in this tab, the content policy forbids network requests, and there is no server that could receive a payload. Only the language, the theme and the last text you typed are kept in this browser.