Generate a draft 2020-12 JSON Schema from a sample document, with required fields and format detection as switches and every limitation stated on the page.
Waiting for a sample document
Infers a draft 2020-12 schema from one sample. It describes that sample, which is not the same as specifying your data.
The schema appears here
A draft inferred from your sample, ready to edit.
JSON Schema Generator runs entirely on your device — nothing is uploaded.
You’re on the Free plan. Compare plans
It describes the sample. That is the whole caveat and it is a large one, so it is on the page rather than in a footnote. A schema inferred from one document is a draft to edit, not a specification, and there are three things it cannot know.
Which fields are optional. Everything present in the sample looks required and everything absent looks nonexistent. The required list is a switch, with everything-present as the default because deleting entries is easier than working out which ones are missing. To find out which fields are genuinely optional you need more than one sample, which is what the structure inspector's presence proportions are for.
What an empty array would have contained. An empty array gives no element type, so the schema says nothing about its items. A schema that claimed otherwise would be inventing a constraint, so the tool counts the positions this affects and tells you how much editing the draft needs.
Which strings are really an enumeration. Three records with a status of active do not tell you whether pending is legal, so nothing here guesses at an enumeration. Adding one is usually the first edit worth making to the generated draft.
Format detection is a guess and is labelled as one. A string matching a date pattern gets a date format, which is usually right and occasionally wrong — a version string, a product code, an identifier that happens to look like a date. It is a switch rather than an assumption. The output is draft 2020-12, which is the current revision and what most validators default to.
It is a draft. It describes one sample, so it cannot know which fields are optional, which strings are enumerations, or what an empty array would contain. Treat it as a starting point to edit rather than a specification.
Because a single sample gives no way to tell. Deleting entries from a required list is far easier than working out which fields are missing from it, which is why that is the default.
Because there is nothing in it to infer from. Describing the items anyway would mean inventing a constraint, so the schema is silent and the tool counts how many positions this affects.
It is a pattern match, so it is usually right and sometimes wrong — a version string or a product code can look like a date. It is a switch so you can turn it off when the sample has strings that only resemble a format.
Draft 2020-12, the current revision, which is what most validators default to. Older drafts differ in how they express array items and conditional rules.
No. Three records with the same status do not establish that no other value is legal. Adding an enumeration is usually the first worthwhile edit to the generated draft.