Debian Codegraph @

ajv-formats/tests/extras/$data/formatMaximum.json

raw symbols SCIP
1 [
2 {
3 "description": "formatMaximum in the property",
4 "schema": {
5 "properties": {
6 "finalDate": {
7 "format": "date",
8 "formatMaximum": {"$data": "1/beforeThan"}
9 },
10 "beforeThan": {}
11 }
12 },
13 "tests": [
14 {
15 "description": "after the maximum date is invalid",
16 "data": {
17 "finalDate": "2015-11-09",
18 "beforeThan": "2015-08-17"
19 },
20 "valid": false
21 },
22 {
23 "description": "boundary point is valid",
24 "data": {
25 "finalDate": "2015-08-17",
26 "beforeThan": "2015-08-17"
27 },
28 "valid": true
29 },
30 {
31 "description": "before the maximum date is valid",
32 "data": {
33 "finalDate": "2014-12-03",
34 "beforeThan": "2015-08-17"
35 },
36 "valid": true
37 },
38 {
39 "description": "ignores non-strings",
40 "data": {
41 "finalDate": 2015,
42 "beforeThan": "2015-08-17"
43 },
44 "valid": true
45 },
46 {
47 "description": "fails if value of formatMaximum is not string",
48 "data": {
49 "finalDate": "2014-12-03",
50 "beforeThan": 2015
51 },
52 "valid": false
53 },
54 {
55 "description": "valid if value of formatMaximum is undefined",
56 "data": {
57 "finalDate": "2014-12-03"
58 },
59 "valid": true
60 }
61 ]
62 },
63 {
64 "description": "formatMaximum in the property with formatExclusiveMaximum",
65 "schema": {
66 "type": "object",
67 "properties": {
68 "finalDate": {
69 "type": "string",
70 "format": "date",
71 "formatExclusiveMaximum": {"$data": "1/beforeThan"}
72 },
73 "beforeThan": {}
74 }
75 },
76 "tests": [
77 {
78 "description": "after the maximum date is still invalid",
79 "data": {
80 "finalDate": "2015-11-09",
81 "beforeThan": "2015-08-17"
82 },
83 "valid": false
84 },
85 {
86 "description": "boundary point is invalid",
87 "data": {
88 "finalDate": "2015-08-17",
89 "beforeThan": "2015-08-17"
90 },
91 "valid": false
92 },
93 {
94 "description": "before the maximum date is still valid",
95 "data": {
96 "finalDate": "2014-12-03",
97 "beforeThan": "2015-08-17"
98 },
99 "valid": true
100 }
101 ]
102 },
103
104 {
105 "description": "formatMaximum with format in the property",
106 "schema": {
107 "type": "object",
108 "properties": {
109 "when": {
110 "type": "string",
111 "format": {"$data": "1/whenFormat"},
112 "formatMaximum": "2015-08-17"
113 },
114 "whenFormat": {}
115 }
116 },
117 "tests": [
118 {
119 "description": "after the maximum date is invalid",
120 "data": {
121 "when": "2015-11-09",
122 "whenFormat": "date"
123 },
124 "valid": false
125 },
126 {
127 "description": "boundary point is valid",
128 "data": {
129 "when": "2015-08-17",
130 "whenFormat": "date"
131 },
132 "valid": true
133 },
134 {
135 "description": "before the maximum date is valid",
136 "data": {
137 "when": "2014-12-03",
138 "whenFormat": "date"
139 },
140 "valid": true
141 }
142 ]
143 },
144 {
145 "description": "formatMaximum with format in the property and with formatExclusiveMaximum",
146 "schema": {
147 "type": "object",
148 "properties": {
149 "when": {
150 "type": "string",
151 "format": {"$data": "1/whenFormat"},
152 "formatExclusiveMaximum": "2015-08-17"
153 },
154 "whenFormat": {}
155 }
156 },
157 "tests": [
158 {
159 "description": "after the maximum date is still invalid",
160 "data": {
161 "when": "2015-11-09",
162 "whenFormat": "date"
163 },
164 "valid": false
165 },
166 {
167 "description": "boundary point is invalid",
168 "data": {
169 "when": "2015-08-17",
170 "whenFormat": "date"
171 },
172 "valid": false
173 },
174 {
175 "description": "before the maximum date is still valid",
176 "data": {
177 "when": "2014-12-03",
178 "whenFormat": "date"
179 },
180 "valid": true
181 }
182 ]
183 },
184
185 {
186 "description": "formatMaximum and format in the properties",
187 "schema": {
188 "type": "object",
189 "properties": {
190 "when": {
191 "type": "string",
192 "format": {"$data": "1/whenFormat"},
193 "formatMaximum": {"$data": "1/beforeThan"}
194 },
195 "whenFormat": {},
196 "beforeThan": {}
197 }
198 },
199 "tests": [
200 {
201 "description": "after the maximum date is invalid",
202 "data": {
203 "when": "2015-11-09",
204 "whenFormat": "date",
205 "beforeThan": "2015-08-17"
206 },
207 "valid": false
208 },
209 {
210 "description": "boundary point is valid",
211 "data": {
212 "when": "2015-08-17",
213 "whenFormat": "date",
214 "beforeThan": "2015-08-17"
215 },
216 "valid": true
217 },
218 {
219 "description": "before the maximum date is valid",
220 "data": {
221 "when": "2014-12-03",
222 "whenFormat": "date",
223 "beforeThan": "2015-08-17"
224 },
225 "valid": true
226 }
227 ]
228 },
229 {
230 "description": "formatMaximum and format in the properties with formatExclusiveMaximum",
231 "schema": {
232 "type": "object",
233 "properties": {
234 "when": {
235 "type": "string",
236 "format": {"$data": "1/whenFormat"},
237 "formatExclusiveMaximum": {"$data": "1/beforeThan"}
238 },
239 "whenFormat": {},
240 "beforeThan": {}
241 }
242 },
243 "tests": [
244 {
245 "description": "after the maximum date is still invalid",
246 "data": {
247 "when": "2015-11-09",
248 "whenFormat": "date",
249 "beforeThan": "2015-08-17"
250 },
251 "valid": false
252 },
253 {
254 "description": "boundary point is invalid",
255 "data": {
256 "when": "2015-08-17",
257 "whenFormat": "date",
258 "beforeThan": "2015-08-17"
259 },
260 "valid": false
261 },
262 {
263 "description": "before the maximum date is still valid",
264 "data": {
265 "when": "2014-12-03",
266 "whenFormat": "date",
267 "beforeThan": "2015-08-17"
268 },
269 "valid": true
270 }
271 ]
272 },
273
274 {
275 "description": "formatExclusiveMaximum in the property",
276 "schema": {
277 "properties": {
278 "finalDate": {
279 "format": "date",
280 "formatExclusiveMaximum": {"$data": "1/beforeThan"}
281 },
282 "beforeThan": {}
283 }
284 },
285 "tests": [
286 {
287 "description": "after the maximum date is invalid",
288 "data": {
289 "finalDate": "2015-11-09",
290 "beforeThan": "2015-08-17"
291 },
292 "valid": false
293 },
294 {
295 "description": "before the maximum date is valid",
296 "data": {
297 "finalDate": "2014-12-03",
298 "beforeThan": "2015-08-17"
299 },
300 "valid": true
301 },
302 {
303 "description": "boundary point is invalid",
304 "data": {
305 "finalDate": "2015-08-17",
306 "beforeThan": "2015-08-17"
307 },
308 "valid": false
309 },
310 {
311 "description": "fails if value of formatExclusiveMaximum is not string",
312 "data": {
313 "finalDate": "2014-12-03",
314 "beforeThan": 2015
315 },
316 "valid": false
317 }
318 ]
319 },
320
321 {
322 "description": "format and formatExclusiveMaximum in the properties",
323 "schema": {
324 "type": "object",
325 "properties": {
326 "when": {
327 "type": "string",
328 "format": {"$data": "1/whenFormat"},
329 "formatExclusiveMaximum": {"$data": "1/beforeThan"}
330 },
331 "beforeThan": {},
332 "whenFormat": {}
333 }
334 },
335 "tests": [
336 {
337 "description": "after the maximum date is invalid",
338 "data": {
339 "when": "2015-11-09",
340 "whenFormat": "date",
341 "beforeThan": "2015-08-17"
342 },
343 "valid": false
344 },
345 {
346 "description": "boundary point is invalid",
347 "data": {
348 "when": "2015-08-17",
349 "whenFormat": "date",
350 "beforeThan": "2015-08-17"
351 },
352 "valid": false
353 },
354 {
355 "description": "before the maximum date is valid",
356 "data": {
357 "when": "2014-12-03",
358 "whenFormat": "date",
359 "beforeThan": "2015-08-17"
360 },
361 "valid": true
362 },
363 {
364 "description": "fails if value of formatExclusiveMaximum is not string",
365 "data": {
366 "when": "2014-12-03",
367 "whenFormat": "date",
368 "beforeThan": 2015
369 },
370 "valid": false
371 }
372 ]
373 }
374 ]