The home of JSON Schema validation right in your browser 🚧 Alpha 🚧 draft-7 only
Valid JSON:
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "definitions": { "subArray": { "type": "array", "items": { "required": [ "alwaysRequiredProp" ], "properties": { "alwaysRequiredProp": { "type": "boolean" }, "requiredPropIfIsParentDependency": { "type": "boolean" } } } } }, "required": [ "isParentDependency", "subArray" ], "properties": { "isParentDependency": { "type": "boolean" }, "subArray": { "$ref": "#/definitions/subArray" } }, "if": { "properties": { "isParentDependency": { "const": true } } }, "then": { "properties": { "subArray": { "items": { "required": [ "requiredPropIfIsParentDependency" ] } } } }}Valid JSON:
{ "isParentDependency": true, "subArray": [ { "alwaysRequiredProp": true } ]}jsonschema.dev@relequestual Thanks to Sponsors: ![]()