How to use the Schema Inspector
Paste a JSON payload and instantly see its typed schema tree — every property, its inferred type, optional vs required, nested arrays and objects, and example values. Use the Schema Inspector to understand undocumented API responses, draft a starter JSON Schema or OpenAPI component, generate TypeScript types, or model a database table from sample data. Inference runs entirely in your browser.
What it does
- Builds a typed tree view of any JSON document.
- Infers JSON Schema (Draft-07 / 2020-12) from one or more sample payloads.
- Detects optional vs required fields across array items.
- Reports arrays of mixed types, deeply nested shapes, and enum candidates (small distinct value sets).
- Suggests formats when fields look like emails, UUIDs, ISO dates, or URLs.
- Copy the inferred schema, send to the JSON Schema Validator, or pivot to JSONPath Tester.
When to use it
- Reverse-engineer the shape of an undocumented third-party API.
- Draft an OpenAPI component schema from an existing response.
- Generate TypeScript / Pydantic / Zod types from a sample payload.
- Plan a database table or NoSQL document model from a real record.
- Onboard to a new service quickly by seeing the response tree at a glance.
- Write fixtures that match production payload structure.
How to use it
- Paste JSON into the editor (or load from clipboard / file).
- The schema tree renders automatically with types, optionality, and example values.
- Paste multiple representative payloads to improve required/optional accuracy across array items.
- Copy the inferred JSON Schema, refine it manually, then run it through the Schema Validator.
- Use the path next to each field as a JSONPath when extracting values downstream.
Tips & pitfalls
- If a field is always
null in your sample, the inferred type is null — provide a non-null example for accurate typing.
- Arrays inferred from a single example may understate variability — paste multiple records when possible.
- Inferred schemas have no
minimum, maximum, enum, or pattern constraints; add those manually after inference.
- Small distinct value sets (e.g.,
"open" | "closed") are suggested as enum candidates — accept or ignore.
- For OpenAPI 3.0, you may need to translate
type: [..., "null"] back to nullable: true.
FAQ
- How do I infer a JSON Schema from a sample? Paste the sample JSON; the Schema Inspector produces a Draft-07/2020-12 schema you can copy and refine.
- How does it detect optional fields? When you paste an array of objects, fields present in some items but not all are marked optional.
- Can I generate TypeScript types? The inferred schema can be fed to a generator (e.g., json-schema-to-typescript). The Inspector itself focuses on the schema tree.
- Does it detect enums and formats? Yes — small distinct value sets are suggested as enums; emails, UUIDs, URLs, and ISO date strings are suggested as
format.
- Is my JSON uploaded? No — all inference happens in your browser.
- What is the difference between this and the Schema Validator? The Inspector infers a schema from data. The Validator checks data against an existing schema.
Runs locally in your browser. No uploads. No analytics on pasted JSON.