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
34 lines
1.1 KiB
JSON
34 lines
1.1 KiB
JSON
[
|
|
{
|
|
"description": "validation of host names",
|
|
"schema": {"format": "hostname"},
|
|
"tests": [
|
|
{
|
|
"description": "a valid host name",
|
|
"data": "www.example.com",
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "a valid punycoded IDN hostname",
|
|
"data": "xn--4gbwdl.xn--wgbh1c",
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "a host name starting with an illegal character",
|
|
"data": "-a-host-name-that-starts-with--",
|
|
"valid": false
|
|
},
|
|
{
|
|
"description": "a host name containing illegal characters",
|
|
"data": "not_a_valid_host_name",
|
|
"valid": false
|
|
},
|
|
{
|
|
"description": "a host name with a component too long",
|
|
"data": "a-vvvvvvvvvvvvvvvveeeeeeeeeeeeeeeerrrrrrrrrrrrrrrryyyyyyyyyyyyyyyy-long-host-name-component",
|
|
"valid": false
|
|
}
|
|
]
|
|
}
|
|
]
|