The home of JSON Schema validation right in your browser 🚧 Alpha 🚧 draft-7 only
Valid JSON:
xxxxxxxxxx{ "$schema": "http://json-schema.org/draft-07/schema", "$id": "http://example.com/example.json", "type": "array", "title": "The root schema", "description": "The root schema comprises the entire JSON document.", "additionalItems": true, "definitions": { "fruit": { "$id": "#/definitions/fruit", "type": "object", "title": "The ez schema", "description": "An explanation about the purpose of this instance.", "default": {}, "required": [ "pips", "berry" ], "properties": { "pips": { "$id": "#/definitions/fruit/pips", "type": "boolean", "title": "Pips", "description": "Does the fruit have pips?", "default": "false", "examples": [ "false", "true" ] }, "name": { "$id": "#/definitions/fruit/name", "type": "string", "examples": [ "orange", "apple" ] }, "colour": { "$id": "#/definitions/fruit/colour", "type": "object", "description": "Colour of the fruit." } }, "additionalProperties": true }, "vegetables": { "$id": "#/definitions/vegetables", "type": "object", "title": "The inputs schema", "description": "An explanation about the purpose of this instance.", "required": [ "type", "nutrition" ], "properties": { "type": { "$id": "#/definitions/vegetables/inputs/properties/type", "type": "string", "description": "An explanation about the purpose of this instance.", "default": "" }, "nutrition": { "$id": "#/definitions/vegetables/inputs/properties/nutrition", "type": "object" }, "colour": { "$id": "#/definitions/vegetables/inputs/properties/colour", "type": "string" } }, "additionalProperties": true } }, "items": { "$id": "#/items", "type": "object", "title": "main schema", "description": "An explanation about the purpose of this instance.", "default": {}, "required": [ "name", "food" ], "properties": { "name": { "$id": "#/items/anyOf/0/properties/name", "type": "string", "title": "The name schema", "description": "An explanation about the purpose of this instance.", "default": "dinner" }, "food": { "$id": "#/items/anyOf/0/properties/food", "type": "string", "title": "The food schema", "description": "An explanation about the purpose of this instance.", "default": "", "examples": [ "vegetable:1", "fruit:5.5.1" ] } }, "oneOf": [ { "if": { "properties": { "food": { "pattern": "^vegetable:[0-9.]+" } } }, "then": { "properties": { "information": { "$ref": "#/definitions/vegetable" } } } }, { "if": { "properties": { "food": { "pattern": "^fruit:[0-9.]+" } } }, "then": { "properties": { "information": { "$ref": "#/definitions/fruit" } } } } ], "additionalProperties": true }}Valid JSON:
xxxxxxxxxx[ { "name": "dinner", "food": "fruit:3.1.5", "information": { "pips": true, "berry": false, "name": "orange" } }, { "name": "lunch", "food": "vegetable:3.1.5", "information": { "type": "root", "nutrition": { "protein": "5g" } } }]jsonschema.dev@relequestual Thanks to Sponsors: ![]()