Skip to content

Commit ba52c48

Browse files
authored
Merge pull request #689 from skryukov/add-schema-keyword-to-required-tests
Add missing $schema keyword to required test cases
2 parents 20f1f52 + d0c602a commit ba52c48

File tree

9 files changed

+66
-9
lines changed

9 files changed

+66
-9
lines changed

tests/draft-next/dependentSchemas.json

+1
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@
132132
{
133133
"description": "dependent subschema incompatible with root",
134134
"schema": {
135+
"$schema": "https://json-schema.org/draft/next/schema",
135136
"properties": {
136137
"foo": {}
137138
},

tests/draft-next/ref.json

+8
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,7 @@
862862
{
863863
"description": "URN ref with nested pointer ref",
864864
"schema": {
865+
"$schema": "https://json-schema.org/draft/next/schema",
865866
"$ref": "urn:uuid:deadbeef-4321-ffff-ffff-1234feebdaed",
866867
"$defs": {
867868
"foo": {
@@ -887,6 +888,7 @@
887888
{
888889
"description": "ref to if",
889890
"schema": {
891+
"$schema": "https://json-schema.org/draft/next/schema",
890892
"$ref": "http://example.com/ref/if",
891893
"if": {
892894
"$id": "http://example.com/ref/if",
@@ -909,6 +911,7 @@
909911
{
910912
"description": "ref to then",
911913
"schema": {
914+
"$schema": "https://json-schema.org/draft/next/schema",
912915
"$ref": "http://example.com/ref/then",
913916
"then": {
914917
"$id": "http://example.com/ref/then",
@@ -931,6 +934,7 @@
931934
{
932935
"description": "ref to else",
933936
"schema": {
937+
"$schema": "https://json-schema.org/draft/next/schema",
934938
"$ref": "http://example.com/ref/else",
935939
"else": {
936940
"$id": "http://example.com/ref/else",
@@ -953,6 +957,7 @@
953957
{
954958
"description": "ref with absolute-path-reference",
955959
"schema": {
960+
"$schema": "https://json-schema.org/draft/next/schema",
956961
"$id": "http://example.com/ref/absref.json",
957962
"$defs": {
958963
"a": {
@@ -982,6 +987,7 @@
982987
{
983988
"description": "$id with file URI still resolves pointers - *nix",
984989
"schema": {
990+
"$schema": "https://json-schema.org/draft/next/schema",
985991
"$id": "file:///folder/file.json",
986992
"$defs": {
987993
"foo": {
@@ -1006,6 +1012,7 @@
10061012
{
10071013
"description": "$id with file URI still resolves pointers - windows",
10081014
"schema": {
1015+
"$schema": "https://json-schema.org/draft/next/schema",
10091016
"$id": "file:///c:/folder/file.json",
10101017
"$defs": {
10111018
"foo": {
@@ -1030,6 +1037,7 @@
10301037
{
10311038
"description": "empty tokens in $ref json-pointer",
10321039
"schema": {
1040+
"$schema": "https://json-schema.org/draft/next/schema",
10331041
"$defs": {
10341042
"": {
10351043
"$defs": {

tests/draft-next/refRemote.json

+13-3
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,10 @@
265265
},
266266
{
267267
"description": "remote HTTP ref with different $id",
268-
"schema": {"$ref": "http://localhost:1234/different-id-ref-string.json"},
268+
"schema": {
269+
"$schema": "https://json-schema.org/draft/next/schema",
270+
"$ref": "http://localhost:1234/different-id-ref-string.json"
271+
},
269272
"tests": [
270273
{
271274
"description": "number is invalid",
@@ -281,7 +284,10 @@
281284
},
282285
{
283286
"description": "remote HTTP ref with different URN $id",
284-
"schema": {"$ref": "http://localhost:1234/urn-ref-string.json"},
287+
"schema": {
288+
"$schema": "https://json-schema.org/draft/next/schema",
289+
"$ref": "http://localhost:1234/urn-ref-string.json"
290+
},
285291
"tests": [
286292
{
287293
"description": "number is invalid",
@@ -297,7 +303,10 @@
297303
},
298304
{
299305
"description": "remote HTTP ref with nested absolute ref",
300-
"schema": {"$ref": "http://localhost:1234/nested-absolute-ref-to-string.json"},
306+
"schema": {
307+
"$schema": "https://json-schema.org/draft/next/schema",
308+
"$ref": "http://localhost:1234/nested-absolute-ref-to-string.json"
309+
},
301310
"tests": [
302311
{
303312
"description": "number is invalid",
@@ -314,6 +323,7 @@
314323
{
315324
"description": "$ref to $ref finds detached $anchor",
316325
"schema": {
326+
"$schema": "https://json-schema.org/draft/next/schema",
317327
"$ref": "http://localhost:1234/draft-next/detached-ref.json#/$defs/foo"
318328
},
319329
"tests": [

tests/draft2019-09/dependentSchemas.json

+1
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@
132132
{
133133
"description": "dependent subschema incompatible with root",
134134
"schema": {
135+
"$schema": "https://json-schema.org/draft/2019-09/schema",
135136
"properties": {
136137
"foo": {}
137138
},

tests/draft2019-09/ref.json

+8
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,7 @@
862862
{
863863
"description": "URN ref with nested pointer ref",
864864
"schema": {
865+
"$schema": "https://json-schema.org/draft/2019-09/schema",
865866
"$ref": "urn:uuid:deadbeef-4321-ffff-ffff-1234feebdaed",
866867
"$defs": {
867868
"foo": {
@@ -887,6 +888,7 @@
887888
{
888889
"description": "ref to if",
889890
"schema": {
891+
"$schema": "https://json-schema.org/draft/2019-09/schema",
890892
"$ref": "http://example.com/ref/if",
891893
"if": {
892894
"$id": "http://example.com/ref/if",
@@ -909,6 +911,7 @@
909911
{
910912
"description": "ref to then",
911913
"schema": {
914+
"$schema": "https://json-schema.org/draft/2019-09/schema",
912915
"$ref": "http://example.com/ref/then",
913916
"then": {
914917
"$id": "http://example.com/ref/then",
@@ -931,6 +934,7 @@
931934
{
932935
"description": "ref to else",
933936
"schema": {
937+
"$schema": "https://json-schema.org/draft/2019-09/schema",
934938
"$ref": "http://example.com/ref/else",
935939
"else": {
936940
"$id": "http://example.com/ref/else",
@@ -953,6 +957,7 @@
953957
{
954958
"description": "ref with absolute-path-reference",
955959
"schema": {
960+
"$schema": "https://json-schema.org/draft/2019-09/schema",
956961
"$id": "http://example.com/ref/absref.json",
957962
"$defs": {
958963
"a": {
@@ -982,6 +987,7 @@
982987
{
983988
"description": "$id with file URI still resolves pointers - *nix",
984989
"schema": {
990+
"$schema": "https://json-schema.org/draft/2019-09/schema",
985991
"$id": "file:///folder/file.json",
986992
"$defs": {
987993
"foo": {
@@ -1006,6 +1012,7 @@
10061012
{
10071013
"description": "$id with file URI still resolves pointers - windows",
10081014
"schema": {
1015+
"$schema": "https://json-schema.org/draft/2019-09/schema",
10091016
"$id": "file:///c:/folder/file.json",
10101017
"$defs": {
10111018
"foo": {
@@ -1030,6 +1037,7 @@
10301037
{
10311038
"description": "empty tokens in $ref json-pointer",
10321039
"schema": {
1040+
"$schema": "https://json-schema.org/draft/2019-09/schema",
10331041
"$defs": {
10341042
"": {
10351043
"$defs": {

tests/draft2019-09/refRemote.json

+13-3
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,10 @@
265265
},
266266
{
267267
"description": "remote HTTP ref with different $id",
268-
"schema": {"$ref": "http://localhost:1234/different-id-ref-string.json"},
268+
"schema": {
269+
"$schema": "https://json-schema.org/draft/2019-09/schema",
270+
"$ref": "http://localhost:1234/different-id-ref-string.json"
271+
},
269272
"tests": [
270273
{
271274
"description": "number is invalid",
@@ -281,7 +284,10 @@
281284
},
282285
{
283286
"description": "remote HTTP ref with different URN $id",
284-
"schema": {"$ref": "http://localhost:1234/urn-ref-string.json"},
287+
"schema": {
288+
"$schema": "https://json-schema.org/draft/2019-09/schema",
289+
"$ref": "http://localhost:1234/urn-ref-string.json"
290+
},
285291
"tests": [
286292
{
287293
"description": "number is invalid",
@@ -297,7 +303,10 @@
297303
},
298304
{
299305
"description": "remote HTTP ref with nested absolute ref",
300-
"schema": {"$ref": "http://localhost:1234/nested-absolute-ref-to-string.json"},
306+
"schema": {
307+
"$schema": "https://json-schema.org/draft/2019-09/schema",
308+
"$ref": "http://localhost:1234/nested-absolute-ref-to-string.json"
309+
},
301310
"tests": [
302311
{
303312
"description": "number is invalid",
@@ -314,6 +323,7 @@
314323
{
315324
"description": "$ref to $ref finds detached $anchor",
316325
"schema": {
326+
"$schema": "https://json-schema.org/draft/2019-09/schema",
317327
"$ref": "http://localhost:1234/draft2019-09/detached-ref.json#/$defs/foo"
318328
},
319329
"tests": [

tests/draft2020-12/dependentSchemas.json

+1
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@
132132
{
133133
"description": "dependent subschema incompatible with root",
134134
"schema": {
135+
"$schema": "https://json-schema.org/draft/2020-12/schema",
135136
"properties": {
136137
"foo": {}
137138
},

tests/draft2020-12/ref.json

+8
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,7 @@
862862
{
863863
"description": "URN ref with nested pointer ref",
864864
"schema": {
865+
"$schema": "https://json-schema.org/draft/2020-12/schema",
865866
"$ref": "urn:uuid:deadbeef-4321-ffff-ffff-1234feebdaed",
866867
"$defs": {
867868
"foo": {
@@ -887,6 +888,7 @@
887888
{
888889
"description": "ref to if",
889890
"schema": {
891+
"$schema": "https://json-schema.org/draft/2020-12/schema",
890892
"$ref": "http://example.com/ref/if",
891893
"if": {
892894
"$id": "http://example.com/ref/if",
@@ -909,6 +911,7 @@
909911
{
910912
"description": "ref to then",
911913
"schema": {
914+
"$schema": "https://json-schema.org/draft/2020-12/schema",
912915
"$ref": "http://example.com/ref/then",
913916
"then": {
914917
"$id": "http://example.com/ref/then",
@@ -931,6 +934,7 @@
931934
{
932935
"description": "ref to else",
933936
"schema": {
937+
"$schema": "https://json-schema.org/draft/2020-12/schema",
934938
"$ref": "http://example.com/ref/else",
935939
"else": {
936940
"$id": "http://example.com/ref/else",
@@ -953,6 +957,7 @@
953957
{
954958
"description": "ref with absolute-path-reference",
955959
"schema": {
960+
"$schema": "https://json-schema.org/draft/2020-12/schema",
956961
"$id": "http://example.com/ref/absref.json",
957962
"$defs": {
958963
"a": {
@@ -982,6 +987,7 @@
982987
{
983988
"description": "$id with file URI still resolves pointers - *nix",
984989
"schema": {
990+
"$schema": "https://json-schema.org/draft/2020-12/schema",
985991
"$id": "file:///folder/file.json",
986992
"$defs": {
987993
"foo": {
@@ -1006,6 +1012,7 @@
10061012
{
10071013
"description": "$id with file URI still resolves pointers - windows",
10081014
"schema": {
1015+
"$schema": "https://json-schema.org/draft/2020-12/schema",
10091016
"$id": "file:///c:/folder/file.json",
10101017
"$defs": {
10111018
"foo": {
@@ -1030,6 +1037,7 @@
10301037
{
10311038
"description": "empty tokens in $ref json-pointer",
10321039
"schema": {
1040+
"$schema": "https://json-schema.org/draft/2020-12/schema",
10331041
"$defs": {
10341042
"": {
10351043
"$defs": {

tests/draft2020-12/refRemote.json

+13-3
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,10 @@
265265
},
266266
{
267267
"description": "remote HTTP ref with different $id",
268-
"schema": {"$ref": "http://localhost:1234/different-id-ref-string.json"},
268+
"schema": {
269+
"$schema": "https://json-schema.org/draft/2020-12/schema",
270+
"$ref": "http://localhost:1234/different-id-ref-string.json"
271+
},
269272
"tests": [
270273
{
271274
"description": "number is invalid",
@@ -281,7 +284,10 @@
281284
},
282285
{
283286
"description": "remote HTTP ref with different URN $id",
284-
"schema": {"$ref": "http://localhost:1234/urn-ref-string.json"},
287+
"schema": {
288+
"$schema": "https://json-schema.org/draft/2020-12/schema",
289+
"$ref": "http://localhost:1234/urn-ref-string.json"
290+
},
285291
"tests": [
286292
{
287293
"description": "number is invalid",
@@ -297,7 +303,10 @@
297303
},
298304
{
299305
"description": "remote HTTP ref with nested absolute ref",
300-
"schema": {"$ref": "http://localhost:1234/nested-absolute-ref-to-string.json"},
306+
"schema": {
307+
"$schema": "https://json-schema.org/draft/2020-12/schema",
308+
"$ref": "http://localhost:1234/nested-absolute-ref-to-string.json"
309+
},
301310
"tests": [
302311
{
303312
"description": "number is invalid",
@@ -314,6 +323,7 @@
314323
{
315324
"description": "$ref to $ref finds detached $anchor",
316325
"schema": {
326+
"$schema": "https://json-schema.org/draft/2020-12/schema",
317327
"$ref": "http://localhost:1234/draft2020-12/detached-ref.json#/$defs/foo"
318328
},
319329
"tests": [

0 commit comments

Comments
 (0)