| •1 |
[ |
| 2 |
{ |
| 3 |
"description": "validation of date strings", |
| 4 |
"schema": { "format": "date" }, |
| 5 |
"tests": [ |
| 6 |
{ |
| 7 |
"description": "all string formats ignore integers", |
| 8 |
"data": 12, |
| 9 |
"valid": true |
| 10 |
}, |
| 11 |
{ |
| 12 |
"description": "all string formats ignore floats", |
| 13 |
"data": 13.7, |
| 14 |
"valid": true |
| 15 |
}, |
| 16 |
{ |
| 17 |
"description": "all string formats ignore objects", |
| 18 |
"data": {}, |
| 19 |
"valid": true |
| 20 |
}, |
| 21 |
{ |
| 22 |
"description": "all string formats ignore arrays", |
| 23 |
"data": [], |
| 24 |
"valid": true |
| 25 |
}, |
| 26 |
{ |
| 27 |
"description": "all string formats ignore booleans", |
| 28 |
"data": false, |
| 29 |
"valid": true |
| 30 |
}, |
| 31 |
{ |
| 32 |
"description": "all string formats ignore nulls", |
| 33 |
"data": null, |
| 34 |
"valid": true |
| 35 |
}, |
| 36 |
{ |
| 37 |
"description": "a valid date string", |
| 38 |
"data": "1963-06-19", |
| 39 |
"valid": true |
| 40 |
}, |
| 41 |
{ |
| 42 |
"description": "a valid date string with 31 days in January", |
| 43 |
"data": "2020-01-31", |
| 44 |
"valid": true |
| 45 |
}, |
| 46 |
{ |
| 47 |
"description": "a invalid date string with 32 days in January", |
| 48 |
"data": "2020-01-32", |
| 49 |
"valid": false |
| 50 |
}, |
| 51 |
{ |
| 52 |
"description": "a valid date string with 28 days in February (normal)", |
| 53 |
"data": "2021-02-28", |
| 54 |
"valid": true |
| 55 |
}, |
| 56 |
{ |
| 57 |
"description": "a invalid date string with 29 days in February (normal)", |
| 58 |
"data": "2021-02-29", |
| 59 |
"valid": false |
| 60 |
}, |
| 61 |
{ |
| 62 |
"description": "a valid date string with 29 days in February (leap)", |
| 63 |
"data": "2020-02-29", |
| 64 |
"valid": true |
| 65 |
}, |
| 66 |
{ |
| 67 |
"description": "a invalid date string with 30 days in February (leap)", |
| 68 |
"data": "2020-02-30", |
| 69 |
"valid": false |
| 70 |
}, |
| 71 |
{ |
| 72 |
"description": "a valid date string with 31 days in March", |
| 73 |
"data": "2020-03-31", |
| 74 |
"valid": true |
| 75 |
}, |
| 76 |
{ |
| 77 |
"description": "a invalid date string with 32 days in March", |
| 78 |
"data": "2020-03-32", |
| 79 |
"valid": false |
| 80 |
}, |
| 81 |
{ |
| 82 |
"description": "a valid date string with 30 days in April", |
| 83 |
"data": "2020-04-30", |
| 84 |
"valid": true |
| 85 |
}, |
| 86 |
{ |
| 87 |
"description": "a invalid date string with 31 days in April", |
| 88 |
"data": "2020-04-31", |
| 89 |
"valid": false |
| 90 |
}, |
| 91 |
{ |
| 92 |
"description": "a valid date string with 31 days in May", |
| 93 |
"data": "2020-05-31", |
| 94 |
"valid": true |
| 95 |
}, |
| 96 |
{ |
| 97 |
"description": "a invalid date string with 32 days in May", |
| 98 |
"data": "2020-05-32", |
| 99 |
"valid": false |
| 100 |
}, |
| 101 |
{ |
| 102 |
"description": "a valid date string with 30 days in June", |
| 103 |
"data": "2020-06-30", |
| 104 |
"valid": true |
| 105 |
}, |
| 106 |
{ |
| 107 |
"description": "a invalid date string with 31 days in June", |
| 108 |
"data": "2020-06-31", |
| 109 |
"valid": false |
| 110 |
}, |
| 111 |
{ |
| 112 |
"description": "a valid date string with 31 days in July", |
| 113 |
"data": "2020-07-31", |
| 114 |
"valid": true |
| 115 |
}, |
| 116 |
{ |
| 117 |
"description": "a invalid date string with 32 days in July", |
| 118 |
"data": "2020-07-32", |
| 119 |
"valid": false |
| 120 |
}, |
| 121 |
{ |
| 122 |
"description": "a valid date string with 31 days in August", |
| 123 |
"data": "2020-08-31", |
| 124 |
"valid": true |
| 125 |
}, |
| 126 |
{ |
| 127 |
"description": "a invalid date string with 32 days in August", |
| 128 |
"data": "2020-08-32", |
| 129 |
"valid": false |
| 130 |
}, |
| 131 |
{ |
| 132 |
"description": "a valid date string with 30 days in September", |
| 133 |
"data": "2020-09-30", |
| 134 |
"valid": true |
| 135 |
}, |
| 136 |
{ |
| 137 |
"description": "a invalid date string with 31 days in September", |
| 138 |
"data": "2020-09-31", |
| 139 |
"valid": false |
| 140 |
}, |
| 141 |
{ |
| 142 |
"description": "a valid date string with 31 days in October", |
| 143 |
"data": "2020-10-31", |
| 144 |
"valid": true |
| 145 |
}, |
| 146 |
{ |
| 147 |
"description": "a invalid date string with 32 days in October", |
| 148 |
"data": "2020-10-32", |
| 149 |
"valid": false |
| 150 |
}, |
| 151 |
{ |
| 152 |
"description": "a valid date string with 30 days in November", |
| 153 |
"data": "2020-11-30", |
| 154 |
"valid": true |
| 155 |
}, |
| 156 |
{ |
| 157 |
"description": "a invalid date string with 31 days in November", |
| 158 |
"data": "2020-11-31", |
| 159 |
"valid": false |
| 160 |
}, |
| 161 |
{ |
| 162 |
"description": "a valid date string with 31 days in December", |
| 163 |
"data": "2020-12-31", |
| 164 |
"valid": true |
| 165 |
}, |
| 166 |
{ |
| 167 |
"description": "a invalid date string with 32 days in December", |
| 168 |
"data": "2020-12-32", |
| 169 |
"valid": false |
| 170 |
}, |
| 171 |
{ |
| 172 |
"description": "a invalid date string with invalid month", |
| 173 |
"data": "2020-13-01", |
| 174 |
"valid": false |
| 175 |
}, |
| 176 |
{ |
| 177 |
"description": "an invalid date string", |
| 178 |
"data": "06/19/1963", |
| 179 |
"valid": false |
| 180 |
}, |
| 181 |
{ |
| 182 |
"description": "only RFC3339 not all of ISO 8601 are valid", |
| 183 |
"data": "2013-350", |
| 184 |
"valid": false |
| 185 |
}, |
| 186 |
{ |
| 187 |
"description": "non-padded month dates are not valid", |
| 188 |
"data": "1998-1-20", |
| 189 |
"valid": false |
| 190 |
}, |
| 191 |
{ |
| 192 |
"description": "non-padded day dates are not valid", |
| 193 |
"data": "1998-01-1", |
| 194 |
"valid": false |
| 195 |
}, |
| 196 |
{ |
| 197 |
"description": "invalid month", |
| 198 |
"data": "1998-13-01", |
| 199 |
"valid": false |
| 200 |
}, |
| 201 |
{ |
| 202 |
"description": "invalid month-day combination", |
| 203 |
"data": "1998-04-31", |
| 204 |
"valid": false |
| 205 |
}, |
| 206 |
{ |
| 207 |
"description": "2021 is not a leap year", |
| 208 |
"data": "2021-02-29", |
| 209 |
"valid": false |
| 210 |
}, |
| 211 |
{ |
| 212 |
"description": "2020 is a leap year", |
| 213 |
"data": "2020-02-29", |
| 214 |
"valid": true |
| 215 |
}, |
| 216 |
{ |
| 217 |
"description": "non-ascii digits should be rejected", |
| 218 |
"data": "1963-06-1৪", |
| 219 |
"valid": false |
| 220 |
} |
| 221 |
] |
| 222 |
} |
| 223 |
] |