207 lines
5.1 KiB
JSON
207 lines
5.1 KiB
JSON
[
|
|
{
|
|
"description": "formatMinimum validation with date format",
|
|
"schema": {
|
|
"format": "date",
|
|
"formatMinimum": "2015-08-17"
|
|
},
|
|
"tests": [
|
|
{
|
|
"description": "after the minimum date is valid",
|
|
"data": "2015-11-09",
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "boundary point is valid",
|
|
"data": "2015-08-17",
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "before the minimum date is invalid",
|
|
"data": "2014-12-03",
|
|
"valid": false
|
|
},
|
|
{
|
|
"description": "ignores non-strings",
|
|
"data": 2015,
|
|
"valid": true
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "exclusiveFormatMinimum validation with date format",
|
|
"schema": {
|
|
"format": "date",
|
|
"formatMinimum": "2015-08-17",
|
|
"exclusiveFormatMinimum": true
|
|
},
|
|
"tests": [
|
|
{
|
|
"description": "after the minimum date is still valid",
|
|
"data": "2015-11-09",
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "boundary point is invalid",
|
|
"data": "2015-08-17",
|
|
"valid": false
|
|
},
|
|
{
|
|
"description": "before the minimum date is still invalid",
|
|
"data": "2014-12-03",
|
|
"valid": false
|
|
}
|
|
]
|
|
},
|
|
|
|
{
|
|
"description": "formatMinimum validation with time format",
|
|
"schema": {
|
|
"format": "time",
|
|
"formatMinimum": "13:15:17.000Z"
|
|
},
|
|
"tests": [
|
|
{
|
|
"description": "time after the minimum time is valid",
|
|
"data": "15:11:09.000Z",
|
|
"valid": true
|
|
},
|
|
{
|
|
"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 minimum time is invalid",
|
|
"data": "10:33:55.000Z",
|
|
"valid": false
|
|
},
|
|
{
|
|
"description": "ignores non-strings",
|
|
"data": 1315,
|
|
"valid": true
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "exclusiveFormatMinimum validation with time format",
|
|
"schema": {
|
|
"format": "time",
|
|
"formatMinimum": "13:15:17.000Z",
|
|
"exclusiveFormatMinimum": true
|
|
},
|
|
"tests": [
|
|
{
|
|
"description": "time after the minimum time is still valid",
|
|
"data": "15:11:09.000Z",
|
|
"valid": true
|
|
},
|
|
{
|
|
"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 minimum time is still invalid",
|
|
"data": "10:33:55.000Z",
|
|
"valid": false
|
|
}
|
|
]
|
|
},
|
|
|
|
{
|
|
"description": "formatMinimum validation with date-time format",
|
|
"schema": {
|
|
"format": "date-time",
|
|
"formatMinimum": "2015-08-17T13:15:17.000Z"
|
|
},
|
|
"tests": [
|
|
{
|
|
"description": "date after the minimum date is valid",
|
|
"data": "2015-11-09T13:15:17.000Z",
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "same date, time after the minimum time is valid",
|
|
"data": "2015-08-17T15:11:09.000Z",
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "boundary point is valid",
|
|
"data": "2015-08-17T13:15:17.000Z",
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "same date, time before the minimum time is invalid",
|
|
"data": "2015-08-17T10:33:55.000Z",
|
|
"valid": false
|
|
},
|
|
{
|
|
"description": "date before the minimum date is invalid",
|
|
"data": "2014-12-03T13:15:17.000Z",
|
|
"valid": false
|
|
},
|
|
{
|
|
"description": "ignores non-strings",
|
|
"data": 2015,
|
|
"valid": true
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "exclusiveFormatMinimum validation with date-time format",
|
|
"schema": {
|
|
"format": "date-time",
|
|
"formatMinimum": "2015-08-17T13:15:17.000Z",
|
|
"exclusiveFormatMinimum": true
|
|
},
|
|
"tests": [
|
|
{
|
|
"description": "date after the minimum date is still valid",
|
|
"data": "2015-11-09T13:15:17.000Z",
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "same date, time after the minimum time is still valid",
|
|
"data": "2015-08-17T15:11:09.000Z",
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "boundary point is invalid",
|
|
"data": "2015-08-17T13:15:17.000Z",
|
|
"valid": false
|
|
},
|
|
{
|
|
"description": "same date, time before the minimum time is stillinvalid",
|
|
"data": "2015-08-17T10:33:55.000Z",
|
|
"valid": false
|
|
},
|
|
{
|
|
"description": "date before the minimum date is still invalid",
|
|
"data": "2014-12-03T13:15:17.000Z",
|
|
"valid": false
|
|
}
|
|
]
|
|
}
|
|
]
|