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",
"title": "JSON Schema for role",
"type": "object",
"properties": {
"user": {
"type": [
"array"
],
"items": {
"type": "string",
"enum": [
"foo",
"bar"
]
}
},
"admin": {
"type": "string"
}
},
"required": [
"user"
],
"if": {
"properties": {
"user": {
"contains": {
"type": "string",
"const": "foo"
}
}
}
},
"then": {
"required": [
"admin"
]
},
"additionalProperties": false
}
Valid JSON:
xxxxxxxxxx
{
"user": [
"foo",
"bar"
]
}
should have required property 'admin'.
required at "#/then/required"
Instance location: ""
should match "then" schema.
if at "#/if"
Instance location: ""
jsonschema.dev@relequestual Thanks to Sponsors: