The home of JSON Schema validation right in your browser 🚧 Alpha 🚧 draft-7 only
Valid JSON:
xxxxxxxxxx
{
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "object",
"additionalProperties": false,
"properties": {
"value": {
"type": "string"
}
}
},
"y": {
"type": "object",
"additionalProperties": false,
"properties": {
"key1": {
"type": "string",
"enum": [
"a",
"b",
"c",
"d",
"e"
]
},
"key2": {
"type": "string",
"enum": [
"x",
"y",
"m",
"n",
"r",
"s"
]
}
}
}
},
"oneOf": [
{
"allOf": [
{
"properties": {
"x": {
"properties": {
"value": {
"const": "myVal"
}
}
},
"y": {
"properties": {
"key1": {
"enum": [
"a",
"b"
]
},
"key2": {
"enum": [
"x",
"y"
]
}
}
}
}
}
]
},
{
"allOf": [
{
"properties": {
"y": {
"properties": {
"key1": {
"enum": [
"c",
"d"
]
},
"key2": {
"enum": [
"m",
"n"
]
}
}
}
}
}
]
},
{
"allOf": [
{
"not": {
"oneOf": [
{
"allOf": [
{
"properties": {
"x": {
"properties": {
"value": {
"const": "myVal"
}
}
},
"y": {
"properties": {
"key1": {
"enum": [
"a",
"b"
]
}
}
}
}
}
]
},
{
"properties": {
"y": {
"properties": {
"key1": {
"enum": [
"c",
"d"
]
}
}
}
}
}
]
}
},
true
]
}
]
}
Valid JSON:
xxxxxxxxxx
{
"x": {
"value": "someOtherVal"
},
"y": {
"key1": "a",
"key2": "m"
}
}
jsonschema.dev@relequestual Thanks to Sponsors: