Debian Codegraph @

share/tests/draft2020-12/optional/format-assertion.json

raw
1 [
2 {
3 "description": "schema that uses custom metaschema with format-assertion: false",
4 "comment": "The true/false boolean in $vocabulary only controls behavior for implementations that do not recognize the vocabulary. For implementations that do understand format-assertion, the boolean has no impact on validation behavior — hence both test groups produce identical results.",
5 "schema": {
6 "$id": "https://schema/using/format-assertion/false",
7 "$schema": "http://localhost:1234/draft2020-12/format-assertion-false.json",
8 "format": "ipv4"
9 },
10 "tests": [
11 {
12 "description": "format-assertion: false: valid string",
13 "data": "127.0.0.1",
14 "valid": true
15 },
16 {
17 "description": "format-assertion: false: invalid string",
18 "comment": "valid: false is intentional — the false value in $vocabulary only affects unknown vocabulary handling, not validation behavior itself",
19 "data": "not-an-ipv4",
20 "valid": false
21 }
22 ]
23 },
24 {
25 "description": "schema that uses custom metaschema with format-assertion: true",
26 "schema": {
27 "$id": "https://schema/using/format-assertion/true",
28 "$schema": "http://localhost:1234/draft2020-12/format-assertion-true.json",
29 "format": "ipv4"
30 },
31 "tests": [
32 {
33 "description": "format-assertion: true: valid string",
34 "data": "127.0.0.1",
35 "valid": true
36 },
37 {
38 "description": "format-assertion: true: invalid string",
39 "data": "not-an-ipv4",
40 "valid": false
41 }
42 ]
43 }
44 ]