Skip to content

Commit da237da

Browse files
committed
draft-specific 2020-12 remotes, $refs, and $ids
1 parent 0eb6893 commit da237da

File tree

10 files changed

+56
-56
lines changed

10 files changed

+56
-56
lines changed

remotes/draft2020-12/extendible-dynamic-ref.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"description": "extendible array",
33
"$schema": "https://json-schema.org/draft/2020-12/schema",
4-
"$id": "http://localhost:1234/extendible-dynamic-ref.json",
4+
"$id": "http://localhost:1234/draft2020-12/extendible-dynamic-ref.json",
55
"type": "object",
66
"properties": {
77
"elements": {

remotes/draft2020-12/ref-and-definitions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://json-schema.org/draft/2020-12/schema",
3-
"$id": "http://localhost:1234/ref-and-definitions.json",
3+
"$id": "http://localhost:1234/draft2020-12/ref-and-definitions.json",
44
"definitions": {
55
"inner": {
66
"properties": {

remotes/draft2020-12/ref-and-defs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://json-schema.org/draft/2020-12/schema",
3-
"$id": "http://localhost:1234/ref-and-defs.json",
3+
"$id": "http://localhost:1234/draft2020-12/ref-and-defs.json",
44
"$defs": {
55
"inner": {
66
"properties": {

remotes/draft2020-12/tree.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"description": "tree schema, extensible",
33
"$schema": "https://json-schema.org/draft/2020-12/schema",
4-
"$id": "http://localhost:1234/tree.json",
4+
"$id": "http://localhost:1234/draft2020-12/tree.json",
55
"$dynamicAnchor": "node",
66

77
"type": "object",

tests/draft2020-12/anchor.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@
2828
"description": "Location-independent identifier with absolute URI",
2929
"schema": {
3030
"$schema": "https://json-schema.org/draft/2020-12/schema",
31-
"$ref": "http://localhost:1234/bar#foo",
31+
"$ref": "http://localhost:1234/draft2020-12/bar#foo",
3232
"$defs": {
3333
"A": {
34-
"$id": "http://localhost:1234/bar",
34+
"$id": "http://localhost:1234/draft2020-12/bar",
3535
"$anchor": "foo",
3636
"type": "integer"
3737
}
@@ -54,8 +54,8 @@
5454
"description": "Location-independent identifier with base URI change in subschema",
5555
"schema": {
5656
"$schema": "https://json-schema.org/draft/2020-12/schema",
57-
"$id": "http://localhost:1234/root",
58-
"$ref": "http://localhost:1234/nested.json#foo",
57+
"$id": "http://localhost:1234/draft2020-12/root",
58+
"$ref": "http://localhost:1234/draft2020-12/nested.json#foo",
5959
"$defs": {
6060
"A": {
6161
"$id": "nested.json",
@@ -143,7 +143,7 @@
143143
"description": "same $anchor with different base uri",
144144
"schema": {
145145
"$schema": "https://json-schema.org/draft/2020-12/schema",
146-
"$id": "http://localhost:1234/foobar",
146+
"$id": "http://localhost:1234/draft2020-12/foobar",
147147
"$defs": {
148148
"A": {
149149
"$id": "child1",

tests/draft2020-12/dynamicRef.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@
458458
"description": "strict-tree schema, guards against misspelled properties",
459459
"schema": {
460460
"$schema": "https://json-schema.org/draft/2020-12/schema",
461-
"$id": "http://localhost:1234/strict-tree.json",
461+
"$id": "http://localhost:1234/draft2020-12/strict-tree.json",
462462
"$dynamicAnchor": "node",
463463

464464
"$ref": "tree.json",
@@ -489,7 +489,7 @@
489489
"description": "tests for implementation dynamic anchor and reference link",
490490
"schema": {
491491
"$schema": "https://json-schema.org/draft/2020-12/schema",
492-
"$id": "http://localhost:1234/strict-extendible.json",
492+
"$id": "http://localhost:1234/draft2020-12/strict-extendible.json",
493493
"$ref": "extendible-dynamic-ref.json",
494494
"$defs": {
495495
"elements": {
@@ -534,7 +534,7 @@
534534
"description": "$ref and $dynamicAnchor are independent of order - $defs first",
535535
"schema": {
536536
"$schema": "https://json-schema.org/draft/2020-12/schema",
537-
"$id": "http://localhost:1234/strict-extendible-allof-defs-first.json",
537+
"$id": "http://localhost:1234/draft2020-12/strict-extendible-allof-defs-first.json",
538538
"allOf": [
539539
{
540540
"$ref": "extendible-dynamic-ref.json"
@@ -585,7 +585,7 @@
585585
"description": "$ref and $dynamicAnchor are independent of order - $ref first",
586586
"schema": {
587587
"$schema": "https://json-schema.org/draft/2020-12/schema",
588-
"$id": "http://localhost:1234/strict-extendible-allof-ref-first.json",
588+
"$id": "http://localhost:1234/draft2020-12/strict-extendible-allof-ref-first.json",
589589
"allOf": [
590590
{
591591
"$defs": {

tests/draft2020-12/id.json

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@
4444
{
4545
"description": "Identifier name with absolute URI",
4646
"data": {
47-
"$ref": "http://localhost:1234/bar#foo",
47+
"$ref": "http://localhost:1234/draft2020-12/bar#foo",
4848
"$defs": {
4949
"A": {
50-
"$id": "http://localhost:1234/bar#foo",
50+
"$id": "http://localhost:1234/draft2020-12/bar#foo",
5151
"type": "integer"
5252
}
5353
}
@@ -57,10 +57,10 @@
5757
{
5858
"description": "Identifier path with absolute URI",
5959
"data": {
60-
"$ref": "http://localhost:1234/bar#/a/b",
60+
"$ref": "http://localhost:1234/draft2020-12/bar#/a/b",
6161
"$defs": {
6262
"A": {
63-
"$id": "http://localhost:1234/bar#/a/b",
63+
"$id": "http://localhost:1234/draft2020-12/bar#/a/b",
6464
"type": "integer"
6565
}
6666
}
@@ -70,8 +70,8 @@
7070
{
7171
"description": "Identifier name with base URI change in subschema",
7272
"data": {
73-
"$id": "http://localhost:1234/root",
74-
"$ref": "http://localhost:1234/nested.json#foo",
73+
"$id": "http://localhost:1234/draft2020-12/root",
74+
"$ref": "http://localhost:1234/draft2020-12/nested.json#foo",
7575
"$defs": {
7676
"A": {
7777
"$id": "nested.json",
@@ -89,8 +89,8 @@
8989
{
9090
"description": "Identifier path with base URI change in subschema",
9191
"data": {
92-
"$id": "http://localhost:1234/root",
93-
"$ref": "http://localhost:1234/nested.json#/a/b",
92+
"$id": "http://localhost:1234/draft2020-12/root",
93+
"$ref": "http://localhost:1234/draft2020-12/nested.json#/a/b",
9494
"$defs": {
9595
"A": {
9696
"$id": "nested.json",
@@ -118,10 +118,10 @@
118118
{
119119
"description": "Identifier name with absolute URI",
120120
"data": {
121-
"$ref": "http://localhost:1234/bar",
121+
"$ref": "http://localhost:1234/draft2020-12/bar",
122122
"$defs": {
123123
"A": {
124-
"$id": "http://localhost:1234/bar#",
124+
"$id": "http://localhost:1234/draft2020-12/bar#",
125125
"type": "integer"
126126
}
127127
}
@@ -131,8 +131,8 @@
131131
{
132132
"description": "Identifier name with base URI change in subschema",
133133
"data": {
134-
"$id": "http://localhost:1234/root",
135-
"$ref": "http://localhost:1234/nested.json#/$defs/B",
134+
"$id": "http://localhost:1234/draft2020-12/root",
135+
"$ref": "http://localhost:1234/draft2020-12/nested.json#/$defs/B",
136136
"$defs": {
137137
"A": {
138138
"$id": "nested.json",
@@ -159,10 +159,10 @@
159159
{
160160
"description": "Unnormalized identifier",
161161
"data": {
162-
"$ref": "http://localhost:1234/foo/baz",
162+
"$ref": "http://localhost:1234/draft2020-12/foo/baz",
163163
"$defs": {
164164
"A": {
165-
"$id": "http://localhost:1234/foo/bar/../baz",
165+
"$id": "http://localhost:1234/draft2020-12/foo/bar/../baz",
166166
"type": "integer"
167167
}
168168
}
@@ -174,7 +174,7 @@
174174
"data": {
175175
"$defs": {
176176
"A": {
177-
"$id": "http://localhost:1234/foo/bar/../baz",
177+
"$id": "http://localhost:1234/draft2020-12/foo/bar/../baz",
178178
"type": "integer"
179179
}
180180
}
@@ -184,10 +184,10 @@
184184
{
185185
"description": "Unnormalized identifier with empty fragment",
186186
"data": {
187-
"$ref": "http://localhost:1234/foo/baz",
187+
"$ref": "http://localhost:1234/draft2020-12/foo/baz",
188188
"$defs": {
189189
"A": {
190-
"$id": "http://localhost:1234/foo/bar/../baz#",
190+
"$id": "http://localhost:1234/draft2020-12/foo/bar/../baz#",
191191
"type": "integer"
192192
}
193193
}
@@ -199,7 +199,7 @@
199199
"data": {
200200
"$defs": {
201201
"A": {
202-
"$id": "http://localhost:1234/foo/bar/../baz#",
202+
"$id": "http://localhost:1234/draft2020-12/foo/bar/../baz#",
203203
"type": "integer"
204204
}
205205
}
@@ -217,32 +217,32 @@
217217
"id_in_enum": {
218218
"enum": [
219219
{
220-
"$id": "https://localhost:1234/id/my_identifier.json",
220+
"$id": "https://localhost:1234/draft2020-12/id/my_identifier.json",
221221
"type": "null"
222222
}
223223
]
224224
},
225225
"real_id_in_schema": {
226-
"$id": "https://localhost:1234/id/my_identifier.json",
226+
"$id": "https://localhost:1234/draft2020-12/id/my_identifier.json",
227227
"type": "string"
228228
},
229229
"zzz_id_in_const": {
230230
"const": {
231-
"$id": "https://localhost:1234/id/my_identifier.json",
231+
"$id": "https://localhost:1234/draft2020-12/id/my_identifier.json",
232232
"type": "null"
233233
}
234234
}
235235
},
236236
"anyOf": [
237237
{ "$ref": "#/$defs/id_in_enum" },
238-
{ "$ref": "https://localhost:1234/id/my_identifier.json" }
238+
{ "$ref": "https://localhost:1234/draft2020-12/id/my_identifier.json" }
239239
]
240240
},
241241
"tests": [
242242
{
243243
"description": "exact match to enum, and type matches",
244244
"data": {
245-
"$id": "https://localhost:1234/id/my_identifier.json",
245+
"$id": "https://localhost:1234/draft2020-12/id/my_identifier.json",
246246
"type": "null"
247247
},
248248
"valid": true

tests/draft2020-12/ref.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@
285285
"description": "Recursive references between schemas",
286286
"schema": {
287287
"$schema": "https://json-schema.org/draft/2020-12/schema",
288-
"$id": "http://localhost:1234/tree",
288+
"$id": "http://localhost:1234/draft2020-12/tree",
289289
"description": "tree of nodes",
290290
"type": "object",
291291
"properties": {
@@ -298,7 +298,7 @@
298298
"required": ["meta", "nodes"],
299299
"$defs": {
300300
"node": {
301-
"$id": "http://localhost:1234/node",
301+
"$id": "http://localhost:1234/draft2020-12/node",
302302
"description": "node",
303303
"type": "object",
304304
"properties": {
@@ -601,7 +601,7 @@
601601
"schema": {
602602
"$comment": "$id must be evaluated before $ref to get the proper $ref destination",
603603
"$schema": "https://json-schema.org/draft/2020-12/schema",
604-
"$id": "/ref-and-id1/base.json",
604+
"$id": "/draft2020-12/ref-and-id1/base.json",
605605
"$ref": "int.json",
606606
"$defs": {
607607
"bigint": {
@@ -611,7 +611,7 @@
611611
},
612612
"smallint": {
613613
"$comment": "canonical uri: /ref-and-id1-int.json",
614-
"$id": "/ref-and-id1-int.json",
614+
"$id": "/draft2020-12/ref-and-id1-int.json",
615615
"maximum": 2
616616
}
617617
}
@@ -634,7 +634,7 @@
634634
"schema": {
635635
"$comment": "$id must be evaluated before $ref to get the proper $ref destination",
636636
"$schema": "https://json-schema.org/draft/2020-12/schema",
637-
"$id": "/ref-and-id2/base.json",
637+
"$id": "/draft2020-12/ref-and-id2/base.json",
638638
"$ref": "#bigint",
639639
"$defs": {
640640
"bigint": {
@@ -644,7 +644,7 @@
644644
},
645645
"smallint": {
646646
"$comment": "canonical uri: /ref-and-id2#/$defs/smallint; another valid uri for this location: /ref-and-id2/#bigint",
647-
"$id": "/ref-and-id2/",
647+
"$id": "/draft2020-12/ref-and-id2/",
648648
"$anchor": "bigint",
649649
"maximum": 2
650650
}

0 commit comments

Comments
 (0)