ES-DE/external/rapidjson/bin/jsonschema/tests/draft3/required.json

54 lines
1.3 KiB
JSON

[
{
"description": "required validation",
"schema": {
"properties": {
"foo": {"required" : true},
"bar": {}
}
},
"tests": [
{
"description": "present required property is valid",
"data": {"foo": 1},
"valid": true
},
{
"description": "non-present required property is invalid",
"data": {"bar": 1},
"valid": false
}
]
},
{
"description": "required default validation",
"schema": {
"properties": {
"foo": {}
}
},
"tests": [
{
"description": "not required by default",
"data": {},
"valid": true
}
]
},
{
"description": "required explicitly false validation",
"schema": {
"properties": {
"foo": {"required": false}
}
},
"tests": [
{
"description": "not required if required is false",
"data": {},
"valid": true
}
]
}
]