221 lines
5.4 KiB
JSON
221 lines
5.4 KiB
JSON
[
|
|
{
|
|
"description": "formatMaximum validation with date format",
|
|
"schema": {
|
|
"format": "date",
|
|
"formatMaximum": "2015-08-17"
|
|
},
|
|
"tests": [
|
|
{
|
|
"description": "after the maximum date is invalid",
|
|
"data": "2015-11-09",
|
|
"valid": false
|
|
},
|
|
{
|
|
"description": "boundary point is valid",
|
|
"data": "2015-08-17",
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "before the maximum date is valid",
|
|
"data": "2014-12-03",
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "ignores non-strings",
|
|
"data": 2015,
|
|
"valid": true
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "formatExclusiveMaximum validation with date format",
|
|
"schema": {
|
|
"format": "date",
|
|
"formatMaximum": "2015-08-17",
|
|
"formatExclusiveMaximum": true
|
|
},
|
|
"tests": [
|
|
{
|
|
"description": "after the maximum date is still invalid",
|
|
"data": "2015-11-09",
|
|
"valid": false
|
|
},
|
|
{
|
|
"description": "boundary point is invalid",
|
|
"data": "2015-08-17",
|
|
"valid": false
|
|
},
|
|
{
|
|
"description": "before the maximum date is still valid",
|
|
"data": "2014-12-03",
|
|
"valid": true
|
|
}
|
|
]
|
|
},
|
|
|
|
{
|
|
"description": "formatMaximum validation with time format",
|
|
"schema": {
|
|
"format": "time",
|
|
"formatMaximum": "13:15:17.000Z"
|
|
},
|
|
"tests": [
|
|
{
|
|
"description": "time after the maximum time is invalid",
|
|
"data": "15:11:09.000Z",
|
|
"valid": false
|
|
},
|
|
{
|
|
"description": "boundary point is valid",
|
|
"data": "13:15:17.000Z",
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "boundary point is valid, timezone is ignored",
|
|
"data": "13:15:17.000+01:00",
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "boundary point is valid, no timezone is ok too",
|
|
"data": "13:15:17.000",
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "time before the maximum time is valid",
|
|
"data": "10:33:55.000Z",
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "ignores non-strings",
|
|
"data": 1315,
|
|
"valid": true
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "formatExclusiveMaximum validation with time format",
|
|
"schema": {
|
|
"format": "time",
|
|
"formatMaximum": "13:15:17.000Z",
|
|
"formatExclusiveMaximum": true
|
|
},
|
|
"tests": [
|
|
{
|
|
"description": "time after the maximum time is still invalid",
|
|
"data": "15:11:09.000Z",
|
|
"valid": false
|
|
},
|
|
{
|
|
"description": "boundary point is invalid",
|
|
"data": "13:15:17.000Z",
|
|
"valid": false
|
|
},
|
|
{
|
|
"description": "boundary point is invalid, timezone is ignored",
|
|
"data": "13:15:17.000+01:00",
|
|
"valid": false
|
|
},
|
|
{
|
|
"description": "boundary point is invalid, no timezone is ok too",
|
|
"data": "13:15:17.000",
|
|
"valid": false
|
|
},
|
|
{
|
|
"description": "time before the maximum time is still valid",
|
|
"data": "10:33:55.000Z",
|
|
"valid": true
|
|
}
|
|
]
|
|
},
|
|
|
|
{
|
|
"description": "formatMaximum validation with date-time format",
|
|
"schema": {
|
|
"format": "date-time",
|
|
"formatMaximum": "2015-08-17T13:15:17.000Z"
|
|
},
|
|
"tests": [
|
|
{
|
|
"description": "date after the maximum date is invalid",
|
|
"data": "2015-11-09T13:15:17.000Z",
|
|
"valid": false
|
|
},
|
|
{
|
|
"description": "same date, time after the maximum time is invalid",
|
|
"data": "2015-08-17T15:11:09.000Z",
|
|
"valid": false
|
|
},
|
|
{
|
|
"description": "boundary point is valid",
|
|
"data": "2015-08-17T13:15:17.000Z",
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "same date, time before the maximum time is valid",
|
|
"data": "2015-08-17T10:33:55.000Z",
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "date before the maximum date is valid",
|
|
"data": "2014-12-03T13:15:17.000Z",
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "ignores non-strings",
|
|
"data": 2015,
|
|
"valid": true
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "formatExclusiveMaximum validation with date-time format",
|
|
"schema": {
|
|
"format": "date-time",
|
|
"formatMaximum": "2015-08-17T13:15:17.000Z",
|
|
"formatExclusiveMaximum": true
|
|
},
|
|
"tests": [
|
|
{
|
|
"description": "date after the maximum date is still invalid",
|
|
"data": "2015-11-09T13:15:17.000Z",
|
|
"valid": false
|
|
},
|
|
{
|
|
"description": "same date, time after the maximum time is still invalid",
|
|
"data": "2015-08-17T15:11:09.000Z",
|
|
"valid": false
|
|
},
|
|
{
|
|
"description": "boundary point is invalid",
|
|
"data": "2015-08-17T13:15:17.000Z",
|
|
"valid": false
|
|
},
|
|
{
|
|
"description": "same date, time before the maximum time is still valid",
|
|
"data": "2015-08-17T10:33:55.000Z",
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "date before the maximum date is still valid",
|
|
"data": "2014-12-03T13:15:17.000Z",
|
|
"valid": true
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "formatMaximum is valid with unknown format",
|
|
"schema": {
|
|
"format": "unknown",
|
|
"formatMaximum": "2015"
|
|
},
|
|
"tests": [
|
|
{
|
|
"description": "always valid",
|
|
"data": "2016",
|
|
"valid": true
|
|
}
|
|
]
|
|
}
|
|
]
|