A schema you can hand to a validator.
Inference emits JSON Schema draft 2020-12: a title, a type per node, properties and required for objects, and an items schema merged across every element of an array.
The rules it follows
- ▸A whole number becomes
integer, a fractional one becomesnumber. Note that2.0and2are the same JSON number, which is another argument for keeping version-like values in strings. - ▸Strings are inspected for
format: email-shaped text getsemail, a URL getsuri, and an ISO stamp getsdateordate-time. - ▸Array elements are generalised together, so a list of records yields one item schema whose
requiredlist is the intersection of the keys every element has. - ▸An empty array becomes
{ "type": "array", "items": {} }— no claim about contents it has never seen.
For a single object, required lists every key, because one document cannot prove that any field is optional. Paste an array of records instead of one object, or mark the optional ones by hand.
Then validate against it
The schema panel runs Ajv over the current document with all errors enabled, so a mismatch reports every failing path rather than stopping at the first. Ajv is loaded against the draft named in $schema, which is why a generated 2020-12 document validates instead of being refused for speaking a dialect the validator did not pick up. Copy the schema into a test and the same check runs in CI without a browser. What a sample can and cannot prove is set out in the schema-from-sample guide.
What you get on this page
- ▸Draft 2020-12 schema inference
- ▸Required fields and type detection
- ▸String format detection for email, URI and dates
- ▸Schema validation powered by Ajv
Because bracekit is a static application, this page loads quickly, caches well and never sends your data to a parsing server. Your formatting preferences, recent documents and snippets stay in local storage.