How are required properties inferred?
A field is required when it appears in every sampled object. With a single object, every field in that sample is required because there is no evidence that it is optional.
Turn representative JSON data into an editable Draft 2020-12 schema with inferred types, object properties, arrays, and required fields.
The generator avoids restrictive guesses such as enums, ranges, and closed objects. Review and edit the result before using it to validate production data, especially when the sample contains only one record.
A field is required when it appears in every sampled object. With a single object, every field in that sample is required because there is no evidence that it is optional.
When samples contain both null and another value type, the generated type includes null. Mixed values in arrays are also combined into a type list instead of being forced into one type.
When format inference is enabled, consistently matching strings can be marked as date, date-time, time, UUID, email, IPv4, or URI. The generator omits the format when samples disagree or are ambiguous.
Use a JSON object or a non-empty array containing only objects. An array of object samples is useful for finding shared required fields. Empty nested arrays remain open because they contain no item examples.
No. The sample is parsed and the schema is generated in this browser tab by this tool. Your JSON is not uploaded to a server.
Related tools: JSON Schema Validator · JSON Formatter