Debian Codegraph @

t/additional-tests-draft7/id.json

raw
1 [
2 {
3 "description": "non-schema object containing an $id property",
4 "schema": {
5 "definitions": {
6 "const_not_id": {
7 "const": {
8 "$id": "not_a_real_id"
9 }
10 }
11 },
12 "if": {
13 "const": "skip not_a_real_id"
14 },
15 "then": true,
16 "else" : {
17 "$ref": "#/definitions/const_not_id"
18 }
19 },
20 "tests": [
21 {
22 "description": "skip traversing definition for a valid result",
23 "data": "skip not_a_real_id",
24 "valid": true
25 },
26 {
27 "description": "const at const_not_id does not match",
28 "data": 1,
29 "valid": false
30 }
31 ]
32 },
33 {
34 "description": "non-schema object containing an anchor property",
35 "schema": {
36 "definitions": {
37 "const_not_anchor": {
38 "const": {
39 "$id": "#not_a_real_anchor"
40 }
41 }
42 },
43 "if": {
44 "const": "skip not_a_real_anchor"
45 },
46 "then": true,
47 "else" : {
48 "$ref": "#/definitions/const_not_anchor"
49 }
50 },
51 "tests": [
52 {
53 "description": "skip traversing definition for a valid result",
54 "data": "skip not_a_real_anchor",
55 "valid": true
56 },
57 {
58 "description": "const at const_not_anchor does not match",
59 "data": 1,
60 "valid": false
61 }
62 ]
63 },
64 {
65 "description": "'' not permitted as $id",
66 "schema": {
67 "$id": "",
68 "type": "string"
69 },
70 "tests": [
71 {
72 "description": "schema would pass without $id",
73 "data": "foo",
74 "valid": false
75 },
76 {
77 "description": "schema would fail even without $id",
78 "data": 1,
79 "valid": false
80 }
81 ]
82 },
83 {
84 "description": "'#' not permitted as $id",
85 "schema": {
86 "$id": "#",
87 "type": "string"
88 },
89 "tests": [
90 {
91 "description": "schema would pass without $id",
92 "data": "foo",
93 "valid": false
94 },
95 {
96 "description": "schema would fail even without $id",
97 "data": 1,
98 "valid": false
99 }
100 ]
101 },
102 {
103 "description": "bad anchor syntax",
104 "schema": {
105 "$id": "#!!hello~"
106 },
107 "tests": [
108 {
109 "description": "draft7 $id passes through to $anchor",
110 "data": "foo",
111 "valid": false
112 }
113 ]
114 }
115 ]