A worked example, rendered from real sample data. Sign in to run the tool on your own input.
{"id":1,"name":"John Doe","email":"john@example.com","age":30,"active":true,"tags":["admin","user"],"address":{"city":"NYC","zip":"10001"}}{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"email": {
"type": "string",
"format": "email"
},
"age": {
"type": "integer"
},
"active": {
"type": "boolean"
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
},
"address": {
"type": "object",
"properties": {
"city": {
"type": "string"
},
"zip": {
"type": "string"
}
},
"required": [
"city",
"zip"
]
}
},
"required": [
"id",
"name",
"email",
"age",
"active",
"tags",
"address"
]
}
Generate JSON Schema from a sample JSON object. Part of the DevTools Surf developer suite. Browse more tools in the Generators collection.