The home of JSON Schema validation right in your browser 🚧 Alpha 🚧 draft-7 only
Valid JSON:
xxxxxxxxxx
{
"type": "object",
"properties": {
"topObj": {
"type": "object",
"properties": {
"subItem1": { "type": "string" },
"subItem2": { "type": "string" },
"ineligibleReason": { "type": "string" },
"if": {
"properties": { "item1.ineligibleReason": { "const": "" } }
},
"then": {
"properties": {
"myObject": {
"type": "object",
"properties": {
"subObject1": { "type": "boolean" },
"subObject2": { "type": "string" }
},
"required": ["subObject1", "subObject2"],
"additionalProperties": false
}
}
},
"else" : {
"properties": { "myObject": { "type": "null" } }
}
},
"required": ["subItem1", "subItem2", "ineligibleReason", "myObject"],
"additionalProperties": false
},
"required": ["topObj"],
"additionalProperties": false
}
}
​
Valid JSON:
xxxxxxxxxx
{
"topObj": {
"subItem1": "2021-09-12",
"subItem2": "2021-09-21",
"ineligibleReason": "",
"myObject": {
"subObject1": true,
"subObject2": ""
}
}
}
​
"/properties/required" should be object,boolean
jsonschema.dev@relequestual Thanks to Sponsors: