[ { "description": "formatMaximum validation with date format", "schema": { "type": "string", "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": "formatExclusiveMaximum validation with date format", "schema": { "type": "string", "format": "date", "formatExclusiveMaximum": "2015-08-17" }, "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": { "type": "string", "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": "time before the maximum time is valid, timezone is taken into account", "data": "13:15:17.000+01:00", "valid": true }, { "description": "boundary point is valid, timezone is taken into account", "data": "14:15:17.000+01:00", "valid": true }, { "description": "time after the maximum time is invalid, timezone is taken into account", "data": "14:20:17.000+01:00", "valid": false }, { "description": "time before the maximum time is valid", "data": "10:33:55.000Z", "valid": true } ] }, { "description": "formatExclusiveMaximum validation with time format", "schema": { "type": "string", "format": "time", "formatExclusiveMaximum": "13:15:17.000Z" }, "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 taken into account", "data": "14:15:17.000+01:00", "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": { "type": "string", "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": "formatExclusiveMaximum validation with date-time format", "schema": { "type": "string", "format": "date-time", "formatExclusiveMaximum": "2015-08-17T13:15:17.000Z" }, "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 validation with iso-time format", "schema": { "type": "string", "format": "iso-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": "time before the maximum time is valid, timezone is ignored", "data": "13:15:16.000+01:00", "valid": true }, { "description": "boundary point is valid, timezone is ignored", "data": "13:15:17.000+01:00", "valid": true }, { "description": "time after the maximum time is invalid, timezone is ignored", "data": "13:15:18.000+01:00", "valid": false }, { "description": "time before the maximum time is valid", "data": "10:33:55.000Z", "valid": true } ] }, { "description": "formatExclusiveMaximum validation with iso-time format", "schema": { "type": "string", "format": "iso-time", "formatExclusiveMaximum": "13:15:17.000Z" }, "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": "time before the maximum time is still valid", "data": "10:33:55.000Z", "valid": true } ] }, { "description": "formatMaximum validation with iso-date-time format", "schema": { "type": "string", "format": "iso-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": "formatExclusiveMaximum validation with iso-date-time format", "schema": { "type": "string", "format": "iso-date-time", "formatExclusiveMaximum": "2015-08-17T13:15:17.000Z" }, "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 whitelisted unknown format", "schema": { "type": "string", "format": "allowedUnknown", "formatMaximum": "2015" }, "tests": [ { "description": "valid string", "data": "2016", "valid": true } ] } ]