A schema generated from a sample document describes what was in the sample. It is a starting point, not a specification handed down from somewhere else, and this tool is built around treating it that way rather than implying more certainty than the data actually supports.
Using the JSON Schema generator
Paste a document, or an array of several records, choose a draft (2020-12 or Draft 07), whether to detect string formats, and whether to mark required keys, then press Generate schema.
Given
[
{"id": 1, "name": "a", "score": 1},
{"id": 2, "name": "b", "score": 1.5}
]
both records carry id, name and score, so all three appear in
required. id is a whole number in every record and becomes "integer".
score has a fraction in the second record, 1.5, so its type is the
broader "number" rather than "integer", since it genuinely holds
non-integer values.
Why a key can silently drop out of required
Add a third record, {"id": 3, "name": "c"}, with no score field, and
regenerate: score is no longer required, while id and name stay
required. A key is only marked required when every single record in the
array carried it. One record missing a field does not prove the field is
optional across your whole API, but it does prove the schema cannot
honestly promise it will always be there, so it becomes optional. That is
the one rule the FAQ on the page states directly, since it is the detail
most likely to surprise someone reading the output.
Format detection
A string format like a date or an email address is only claimed when every string in that position across every record matched the same pattern. This is what stops one lucky value from turning a genuinely free text field into something that looks like a strict date format, which would then reject real, valid data the moment it saw a value that was not actually a date.
What this cannot know
The generator has only the records you pasted. It cannot see the records
you did not paste, so a field that always happened to be a positive number
in your sample will not come back with a minimum unless you add one
yourself, and an enum-like field will not become an enum keyword unless
you add it. Treat the output as the shape your sample proves, and widen it
by hand where you know the real data is looser.
Checking the result
Paste the generated schema and a document into the JSON Schema validator to see whether it actually accepts the kind of documents you expect it to.