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",
"properties":{
"id":{"type":"string"},
"ts":{"type":"string"},
"complex_rules": {
"type": "array",
"if": {
"contains": {
"required": ["type"],
"properties": {
"type": { "const": "admin" }
}
}
},
"then": {
"not": {
"contains": {
"required": ["type", "rights"],
"properties": {
"type": {
"not": { "const": "admin" }
}
}
}
}
},
"contains": {
"type": "object",
"required": ["rights"]
},
"minItems": 1,
"items": {
"type": "object",
"properties": {
"type": {
"enum": ["guest", "admin"]
},
"rights": {
"type": "string"
},
"hyperLink": {
"type": "string",
"format": "uri"
}
}
}
}
}
}
Valid JSON:
{
"complex_rules":[
{
"type":"admin",
"hyperLink": "http://www.someguest.com",
"rights":"all",
"rule":{
"rights":"all",
"remarks": "some admin remarks"
}
},
{
"type":"guest",
"hyperLink": "http://www.someadmin.com",
"rights":"all"
}
]
}
jsonschema.dev@relequestual Thanks to Sponsors: