json-schema-validator/test/JSON-Schema-Test-Suite/tests/draft7/optional/format/date-time.json
Patrick Boettcher 7beb40bc61 Complete rewrite of the validator - aiming a 2.0-release
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
2018-12-27 16:59:19 +01:00

54 lines
1.7 KiB
JSON

[
{
"description": "validation of date-time strings",
"schema": {"format": "date-time"},
"tests": [
{
"description": "a valid date-time string",
"data": "1963-06-19T08:30:06.283185Z",
"valid": true
},
{
"description": "a valid date-time string without second fraction",
"data": "1963-06-19T08:30:06Z",
"valid": true
},
{
"description": "a valid date-time string with plus offset",
"data": "1937-01-01T12:00:27.87+00:20",
"valid": true
},
{
"description": "a valid date-time string with minus offset",
"data": "1990-12-31T15:59:50.123-08:00",
"valid": true
},
{
"description": "a invalid day in date-time string",
"data": "1990-02-31T15:59:60.123-08:00",
"valid": false
},
{
"description": "an invalid offset in date-time string",
"data": "1990-12-31T15:59:60-24:00",
"valid": false
},
{
"description": "an invalid date-time string",
"data": "06/19/1963 08:30:06 PST",
"valid": false
},
{
"description": "case-insensitive T and Z",
"data": "1963-06-19t08:30:06.283185z",
"valid": true
},
{
"description": "only RFC3339 not all of ISO 8601 are valid",
"data": "2013-350T01:01:01",
"valid": false
}
]
}
]