What this JSON Schema generator does
Paste one valid JSON value and generate a schema describing its observed structure. Object properties inherit their types from the sample, arrays infer their item type from the values present, and keys in the sample are marked required. The output uses JSON Schema Draft 2020-12 and can be copied into an API or validation project as a starting point.
Example and important limitations
A sample such as {"name":"Ada","active":true} produces an object schema with a string name and boolean active. One example cannot reveal optional properties, all allowed values, numeric limits, formats, or business rules. Add realistic samples, then edit the generated schema to express what is allowed rather than merely what appeared once.
Frequently asked questions
Does this prove that my API payload is correct?
No. The generated schema is inferred from sample data and has not been tested against your API contract or application rules.
What happens with empty arrays?
An empty array has no item examples, so its generated items schema is left open. Define the intended item type yourself.
Are nested objects supported?
Yes. The generator recursively describes nested objects and arrays using the sample values.
Review required and optional properties
The generated schema marks every property in the sample as required because one observation cannot show which fields may be omitted. If an API accepts an optional property, remove that name from the object's required array. If a value can be null as well as a string, number, or object, make that alternative explicit in the schema rather than relying on a sample that happened to contain null. Likewise, a single numeric example cannot tell whether negative values, decimal values, or a particular range should be accepted.
Arrays need representative examples too. A sample containing only strings does not establish whether mixed item types are valid; an empty array provides no evidence about its item type at all. The generator combines observed array item types, but you should compare those inferred alternatives with the application contract. Use several examples from normal and edge-case payloads, then add constraints such as minimum, maxLength, and format when they are actually part of the requirements. Validate the final schema using your application's chosen JSON Schema validator before depending on it.