Start from an example
Objects, arrays, strings, and numbers map to the matching type. Nested objects are expanded into properties where possible.
If an array is empty, item types may be wrong. Add a real element and infer again.
You can also load data via #data={"name":"Ada"} or #url=... It is cleared from the address bar after it is read.
Infer a JSON Schema from a sample JSON document. Useful when you already have a real response and still need API docs or a starting point for a validator. Review required fields and enums by hand—the tool only sees “what this example contains,” not “what the product must have.”
Objects, arrays, strings, and numbers map to the matching type. Nested objects are expanded into properties where possible.
If an array is empty, item types may be wrong. Add a real element and infer again.
Inference cannot know whether a field is required—you still edit required. Optional fields, enums, and format (email, uri) also need a human pass.
Hand the result to ajv or similar in CI. That is more reliable than a verbal agreement.
Sample data is not uploaded. Still redact production samples first.
Output includes a $schema declaration so other tools can recognize the version.
{
"id": 1001,
"name": "Ada",
"active": true
}
{
"type": "object",
"properties": {
"id": { "type": "number" },
"name": { "type": "string" },
"active": { "type": "boolean" }
}
}
This page focuses on generating a Schema from a sample. Hand the result to ajv or similar on the backend or in CI for validation.
Inference walks down as far as it can. Empty arrays without an item sample may get the item type wrong.
Use Schema for REST / JSON docs. Use the type-inference page for GraphQL services.
Type inference is the priority. Add email and other formats to the Schema based on the product.
One example cannot produce a complete contract. Cross-check several samples, then tighten the Schema.