Schema a now "parsed" into C++-validator-objects in a first step and then validation takes place with these objects. Errors are now handled via a user-provided error-handler allowing the user to collect all errors at once or bail out when a certain threshold is reached. Fixes #36 and #8. One (sub-)schema can now be referenced with different URIs. Fixes #9 JSON schema draft 7 is now supported. Fixes #35
39 lines
1004 B
JSON
39 lines
1004 B
JSON
[
|
|
{
|
|
"description": "minProperties validation",
|
|
"schema": {"minProperties": 1},
|
|
"tests": [
|
|
{
|
|
"description": "longer is valid",
|
|
"data": {"foo": 1, "bar": 2},
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "exact length is valid",
|
|
"data": {"foo": 1},
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "too short is invalid",
|
|
"data": {},
|
|
"valid": false
|
|
},
|
|
{
|
|
"description": "ignores arrays",
|
|
"data": [],
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "ignores strings",
|
|
"data": "",
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "ignores other non-objects",
|
|
"data": 12,
|
|
"valid": true
|
|
}
|
|
]
|
|
}
|
|
]
|