JSON Schema Generator
Generate a starter Draft 2020-12 schema from a sample JSON document.
Open toolGenerate editable TypeScript definitions from a JSON sample, including nested objects and arrays.
{
"users": [{"display-name": "Ada", "workspaceId": 42}],
"nextPage": null
}
Use UsersResponse as the root name. The output quotes the hyphenated property and reflects the observed null. Widen nextPage if the API can also return a string or number.
TypeScript checks types during development. Use a separate runtime validator when a response comes from an untrusted or changing source.
Names that cannot safely be emitted as identifiers are represented as quoted property names.
The generator represents the observed element types as a union. Empty arrays use Array<unknown> until you can supply a representative element type.