Skip to content

Commit 0173a08

Browse files
Revert "by default, "format" only annotates, not validates"
This reverts commit 043dc63 (and also removes the tests from draft-future, which were copied from draft2020-12). According to the spec, "$vocabulary": { "...format-assertion": false } does not mean "do not assert formats", but rather "if you don't support format-assertion, you can still load the schema. but if you do support it, feel free to assert that behaviour if you wish". ref. https://json-schema.org/draft/2020-12/json-schema-core.html#rfc.section.8.1.2 As such, the data in the removed tests could result in either a true OR a false result. If we wish to explicitly test "formats are only annotations, and NOT assertions" behaviour, we will have to define a custom metaschema and reference that with the $schema keyword, where the metaschema contains: "$vocabulary": { ... "https://json-schema.org/draft/2020-12/vocab/format-annotation": true, } and does NOT mention the format-assertion vocabulary whatsoever. This would be a reasonable test of the $vocabulary keyword, too.
1 parent 66e813a commit 0173a08

File tree

3 files changed

+0
-285
lines changed

3 files changed

+0
-285
lines changed

tests/draft-future/format.json

-95
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@
3232
"description": "all string formats ignore nulls",
3333
"data": null,
3434
"valid": true
35-
},
36-
{
37-
"description": "invalid email string is only an annotation by default",
38-
"data": "2962",
39-
"valid": true
4035
}
4136
]
4237
},
@@ -73,11 +68,6 @@
7368
"description": "all string formats ignore nulls",
7469
"data": null,
7570
"valid": true
76-
},
77-
{
78-
"description": "invalid idn-email string is only an annotation by default",
79-
"data": "2962",
80-
"valid": true
8171
}
8272
]
8373
},
@@ -114,11 +104,6 @@
114104
"description": "all string formats ignore nulls",
115105
"data": null,
116106
"valid": true
117-
},
118-
{
119-
"description": "invalid regex string is only an annotation by default",
120-
"data": "^(abc]",
121-
"valid": true
122107
}
123108
]
124109
},
@@ -155,11 +140,6 @@
155140
"description": "all string formats ignore nulls",
156141
"data": null,
157142
"valid": true
158-
},
159-
{
160-
"description": "invalid ipv4 string is only an annotation by default",
161-
"data": "127.0.0.0.1",
162-
"valid": true
163143
}
164144
]
165145
},
@@ -196,11 +176,6 @@
196176
"description": "all string formats ignore nulls",
197177
"data": null,
198178
"valid": true
199-
},
200-
{
201-
"description": "invalid ipv6 string is only an annotation by default",
202-
"data": "12345::",
203-
"valid": true
204179
}
205180
]
206181
},
@@ -237,11 +212,6 @@
237212
"description": "all string formats ignore nulls",
238213
"data": null,
239214
"valid": true
240-
},
241-
{
242-
"description": "invalid idn-hostname string is only an annotation by default",
243-
"data": "〮실례.테스트",
244-
"valid": true
245215
}
246216
]
247217
},
@@ -278,11 +248,6 @@
278248
"description": "all string formats ignore nulls",
279249
"data": null,
280250
"valid": true
281-
},
282-
{
283-
"description": "invalid hostname string is only an annotation by default",
284-
"data": "-a-host-name-that-starts-with--",
285-
"valid": true
286251
}
287252
]
288253
},
@@ -319,11 +284,6 @@
319284
"description": "all string formats ignore nulls",
320285
"data": null,
321286
"valid": true
322-
},
323-
{
324-
"description": "invalid date string is only an annotation by default",
325-
"data": "06/19/1963",
326-
"valid": true
327287
}
328288
]
329289
},
@@ -360,11 +320,6 @@
360320
"description": "all string formats ignore nulls",
361321
"data": null,
362322
"valid": true
363-
},
364-
{
365-
"description": "invalid date-time string is only an annotation by default",
366-
"data": "1990-02-31T15:59:60.123-08:00",
367-
"valid": true
368323
}
369324
]
370325
},
@@ -401,11 +356,6 @@
401356
"description": "all string formats ignore nulls",
402357
"data": null,
403358
"valid": true
404-
},
405-
{
406-
"description": "invalid time string is only an annotation by default",
407-
"data": "08:30:06 PST",
408-
"valid": true
409359
}
410360
]
411361
},
@@ -442,11 +392,6 @@
442392
"description": "all string formats ignore nulls",
443393
"data": null,
444394
"valid": true
445-
},
446-
{
447-
"description": "invalid json-pointer string is only an annotation by default",
448-
"data": "/foo/bar~",
449-
"valid": true
450395
}
451396
]
452397
},
@@ -483,11 +428,6 @@
483428
"description": "all string formats ignore nulls",
484429
"data": null,
485430
"valid": true
486-
},
487-
{
488-
"description": "invalid relative-json-pointer string is only an annotation by default",
489-
"data": "/foo/bar",
490-
"valid": true
491431
}
492432
]
493433
},
@@ -524,11 +464,6 @@
524464
"description": "all string formats ignore nulls",
525465
"data": null,
526466
"valid": true
527-
},
528-
{
529-
"description": "invalid iri string is only an annotation by default",
530-
"data": "http://2001:0db8:85a3:0000:0000:8a2e:0370:7334",
531-
"valid": true
532467
}
533468
]
534469
},
@@ -565,11 +500,6 @@
565500
"description": "all string formats ignore nulls",
566501
"data": null,
567502
"valid": true
568-
},
569-
{
570-
"description": "invalid iri-reference string is only an annotation by default",
571-
"data": "\\\\WINDOWS\\filëßåré",
572-
"valid": true
573503
}
574504
]
575505
},
@@ -606,11 +536,6 @@
606536
"description": "all string formats ignore nulls",
607537
"data": null,
608538
"valid": true
609-
},
610-
{
611-
"description": "invalid uri string is only an annotation by default",
612-
"data": "//foo.bar/?baz=qux#quux",
613-
"valid": true
614539
}
615540
]
616541
},
@@ -647,11 +572,6 @@
647572
"description": "all string formats ignore nulls",
648573
"data": null,
649574
"valid": true
650-
},
651-
{
652-
"description": "invalid uri-reference string is only an annotation by default",
653-
"data": "\\\\WINDOWS\\fileshare",
654-
"valid": true
655575
}
656576
]
657577
},
@@ -688,11 +608,6 @@
688608
"description": "all string formats ignore nulls",
689609
"data": null,
690610
"valid": true
691-
},
692-
{
693-
"description": "invalid uri-template string is only an annotation by default",
694-
"data": "http://example.com/dictionary/{term:1}/{term",
695-
"valid": true
696611
}
697612
]
698613
},
@@ -729,11 +644,6 @@
729644
"description": "all string formats ignore nulls",
730645
"data": null,
731646
"valid": true
732-
},
733-
{
734-
"description": "invalid uuid string is only an annotation by default",
735-
"data": "2eb8aa08-aa98-11ea-b4aa-73b441d1638",
736-
"valid": true
737647
}
738648
]
739649
},
@@ -770,11 +680,6 @@
770680
"description": "all string formats ignore nulls",
771681
"data": null,
772682
"valid": true
773-
},
774-
{
775-
"description": "invalid duration string is only an annotation by default",
776-
"data": "PT1D",
777-
"valid": true
778683
}
779684
]
780685
}

0 commit comments

Comments
 (0)