Convert a JSON object into a strict schema
Paste this object and choose Generate schema. The integer and boolean values become field types; both fields are required and extra properties are rejected by the generated schema.
Input
{
"id": 1,
"active": true
}Output
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "GeneratedSchema",
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"active": {
"type": "boolean"
}
},
"required": [
"id",
"active"
],
"additionalProperties": false
}- The generator infers array item types from the first item only. It uses string items for an empty array. Review arrays containing mixed types before using the schema.
- A sample cannot reveal optional fields, all allowed values, string formats or business rules. Add those constraints yourself and test against representative data.
- This tool generates a schema; it does not validate other documents against it. Check the schema subset supported by your validator or AI provider.