Skip to content

Commit d837e97

Browse files
committed
Merge commit '4ecbea58e0828696f7714abba624e2160518fddd'
* commit '4ecbea58e0828696f7714abba624e2160518fddd': Squashed 'json/' changes from 54440eab4..ba3a90534
2 parents 53864d2 + 4ecbea5 commit d837e97

File tree

85 files changed

+680
-22
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+680
-22
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$id": "http://localhost:1234/draft2019-09/metaschema-no-validation.json",
3+
"$vocabulary": {
4+
"https://json-schema.org/draft/2019-09/vocab/applicator": true,
5+
"https://json-schema.org/draft/2019-09/vocab/core": true
6+
},
7+
"allOf": [
8+
{ "$ref": "https://json-schema.org/draft/2019-09/meta/applicator" },
9+
{ "$ref": "https://json-schema.org/draft/2019-09/meta/core" }
10+
]
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$id": "http://localhost:1234/draft2020-12/metaschema-no-validation.json",
3+
"$vocabulary": {
4+
"https://json-schema.org/draft/2020-12/vocab/applicator": true,
5+
"https://json-schema.org/draft/2020-12/vocab/core": true
6+
},
7+
"allOf": [
8+
{ "$ref": "https://json-schema.org/draft/2020-12/meta/applicator" },
9+
{ "$ref": "https://json-schema.org/draft/2020-12/meta/core" }
10+
]
11+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"description": "extendible array",
3+
"$id": "http://localhost:1234/extendible-dynamic-ref.json",
4+
"type": "object",
5+
"properties": {
6+
"elements": {
7+
"type": "array",
8+
"items": {
9+
"$dynamicRef": "#elements"
10+
}
11+
}
12+
},
13+
"required": ["elements"],
14+
"additionalProperties": false,
15+
"$defs": {
16+
"elements": {
17+
"$dynamicAnchor": "elements"
18+
}
19+
}
20+
}

json/remotes/tree.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"description": "tree schema, extensible",
3+
"$id": "http://localhost:1234/tree.json",
4+
"$dynamicAnchor": "node",
5+
6+
"type": "object",
7+
"properties": {
8+
"data": true,
9+
"children": {
10+
"type": "array",
11+
"items": {
12+
"$dynamicRef": "#node"
13+
}
14+
}
15+
}
16+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

json/tests/draft-future/dynamicRef.json renamed to json/tests/draft-next/dynamicRef.json

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,5 +441,179 @@
441441
"valid": true
442442
}
443443
]
444+
},
445+
{
446+
"description": "strict-tree schema, guards against misspelled properties",
447+
"schema": {
448+
"$id": "http://localhost:1234/strict-tree.json",
449+
"$dynamicAnchor": "node",
450+
451+
"$ref": "tree.json",
452+
"unevaluatedProperties": false
453+
},
454+
"tests": [
455+
{
456+
"description": "instance with misspelled field",
457+
"data": {
458+
"children": [{
459+
"daat": 1
460+
}]
461+
},
462+
"valid": false
463+
},
464+
{
465+
"description": "instance with correct field",
466+
"data": {
467+
"children": [{
468+
"data": 1
469+
}]
470+
},
471+
"valid": true
472+
}
473+
]
474+
},
475+
{
476+
"description": "tests for implementation dynamic anchor and reference link",
477+
"schema": {
478+
"$id": "http://localhost:1234/strict-extendible.json",
479+
"$ref": "extendible-dynamic-ref.json",
480+
"$defs": {
481+
"elements": {
482+
"$dynamicAnchor": "elements",
483+
"properties": {
484+
"a": true
485+
},
486+
"required": ["a"],
487+
"additionalProperties": false
488+
}
489+
}
490+
},
491+
"tests": [
492+
{
493+
"description": "incorrect parent schema",
494+
"data": {
495+
"a": true
496+
},
497+
"valid": false
498+
},
499+
{
500+
"description": "incorrect extended schema",
501+
"data": {
502+
"elements": [
503+
{ "b": 1 }
504+
]
505+
},
506+
"valid": false
507+
},
508+
{
509+
"description": "correct extended schema",
510+
"data": {
511+
"elements": [
512+
{ "a": 1 }
513+
]
514+
},
515+
"valid": true
516+
}
517+
]
518+
},
519+
{
520+
"description": "Tests for implementation dynamic anchor and reference link. Reference should be independent of any possible ordering.",
521+
"schema": {
522+
"$id": "http://localhost:1234/strict-extendible-allof-defs-first.json",
523+
"allOf": [
524+
{
525+
"$ref": "extendible-dynamic-ref.json"
526+
},
527+
{
528+
"$defs": {
529+
"elements": {
530+
"$dynamicAnchor": "elements",
531+
"properties": {
532+
"a": true
533+
},
534+
"required": ["a"],
535+
"additionalProperties": false
536+
}
537+
}
538+
}
539+
]
540+
},
541+
"tests": [
542+
{
543+
"description": "incorrect parent schema",
544+
"data": {
545+
"a": true
546+
},
547+
"valid": false
548+
},
549+
{
550+
"description": "incorrect extended schema",
551+
"data": {
552+
"elements": [
553+
{ "b": 1 }
554+
]
555+
},
556+
"valid": false
557+
},
558+
{
559+
"description": "correct extended schema",
560+
"data": {
561+
"elements": [
562+
{ "a": 1 }
563+
]
564+
},
565+
"valid": true
566+
}
567+
]
568+
},
569+
{
570+
"description": "Tests for implementation dynamic anchor and reference link. Reference should be independent of any possible ordering.",
571+
"schema": {
572+
"$id": "http://localhost:1234/strict-extendible-allof-ref-first.json",
573+
"allOf": [
574+
{
575+
"$defs": {
576+
"elements": {
577+
"$dynamicAnchor": "elements",
578+
"properties": {
579+
"a": true
580+
},
581+
"required": ["a"],
582+
"additionalProperties": false
583+
}
584+
}
585+
},
586+
{
587+
"$ref": "extendible-dynamic-ref.json"
588+
}
589+
]
590+
},
591+
"tests": [
592+
{
593+
"description": "incorrect parent schema",
594+
"data": {
595+
"a": true
596+
},
597+
"valid": false
598+
},
599+
{
600+
"description": "incorrect extended schema",
601+
"data": {
602+
"elements": [
603+
{ "b": 1 }
604+
]
605+
},
606+
"valid": false
607+
},
608+
{
609+
"description": "correct extended schema",
610+
"data": {
611+
"elements": [
612+
{ "a": 1 }
613+
]
614+
},
615+
"valid": true
616+
}
617+
]
444618
}
445619
]
File renamed without changes.

json/tests/draft-future/id.json renamed to json/tests/draft-next/id.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{
33
"description": "Invalid use of fragments in location-independent $id",
44
"schema": {
5-
"$ref": "https://json-schema.org/draft/future/schema"
5+
"$ref": "https://json-schema.org/draft/next/schema"
66
},
77
"tests": [
88
{
@@ -110,7 +110,7 @@
110110
"description": "Valid use of empty fragments in location-independent $id",
111111
"comment": "These are allowed but discouraged",
112112
"schema": {
113-
"$ref": "https://json-schema.org/draft/future/schema"
113+
"$ref": "https://json-schema.org/draft/next/schema"
114114
},
115115
"tests": [
116116
{
@@ -150,7 +150,7 @@
150150
{
151151
"description": "Unnormalized $ids are allowed but discouraged",
152152
"schema": {
153-
"$ref": "https://json-schema.org/draft/future/schema"
153+
"$ref": "https://json-schema.org/draft/next/schema"
154154
},
155155
"tests": [
156156
{
File renamed without changes.
File renamed without changes.
File renamed without changes.

json/tests/draft-future/optional/format/date-time.json renamed to json/tests/draft-next/optional/format/date-time.json

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,38 @@
5454
"valid": true
5555
},
5656
{
57-
"description": "a invalid day in date-time string",
58-
"data": "1990-02-31T15:59:60.123-08:00",
57+
"description": "a valid date-time with a leap second, UTC",
58+
"data": "1998-12-31T23:59:60Z",
59+
"valid": true
60+
},
61+
{
62+
"description": "a valid date-time with a leap second, with minus offset",
63+
"data": "1998-12-31T15:59:60.123-08:00",
64+
"valid": true
65+
},
66+
{
67+
"description": "an invalid date-time past leap second, UTC",
68+
"data": "1998-12-31T23:59:61Z",
69+
"valid": false
70+
},
71+
{
72+
"description": "an invalid date-time with leap second on a wrong minute, UTC",
73+
"data": "1998-12-31T23:58:60Z",
74+
"valid": false
75+
},
76+
{
77+
"description": "an invalid date-time with leap second on a wrong hour, UTC",
78+
"data": "1998-12-31T22:59:60Z",
79+
"valid": false
80+
},
81+
{
82+
"description": "an invalid day in date-time string",
83+
"data": "1990-02-31T15:59:59.123-08:00",
5984
"valid": false
6085
},
6186
{
6287
"description": "an invalid offset in date-time string",
63-
"data": "1990-12-31T15:59:60-24:00",
88+
"data": "1990-12-31T15:59:59-24:00",
6489
"valid": false
6590
},
6691
{

json/tests/draft-future/ref.json renamed to json/tests/draft-next/ref.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@
178178
{
179179
"description": "remote ref, containing refs itself",
180180
"schema": {
181-
"$ref": "https://json-schema.org/draft/future/schema"
181+
"$ref": "https://json-schema.org/draft/next/schema"
182182
},
183183
"tests": [
184184
{
File renamed without changes.

json/tests/draft-next/vocabulary.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[
2+
{
3+
"description": "schema that uses custom metaschema with with no validation vocabulary",
4+
"schema": {
5+
"$id": "https://schema/using/no/validation",
6+
"$schema": "http://localhost:1234/draft2020-12/metaschema-no-validation.json",
7+
"properties": {
8+
"badProperty": false,
9+
"numberProperty": {
10+
"minimum": 10
11+
}
12+
}
13+
},
14+
"tests": [
15+
{
16+
"description": "applicator vocabulary still works",
17+
"data": {
18+
"badProperty": "this property should not exist"
19+
},
20+
"valid": false
21+
},
22+
{
23+
"description": "no validation: valid number",
24+
"data": 20,
25+
"valid": true
26+
},
27+
{
28+
"description": "no validation: invalid number, but it still validates",
29+
"data": 1,
30+
"valid": true
31+
}
32+
]
33+
}
34+
]

json/tests/draft2019-09/optional/format/date-time.json

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,38 @@
5454
"valid": true
5555
},
5656
{
57-
"description": "a invalid day in date-time string",
58-
"data": "1990-02-31T15:59:60.123-08:00",
57+
"description": "a valid date-time with a leap second, UTC",
58+
"data": "1998-12-31T23:59:60Z",
59+
"valid": true
60+
},
61+
{
62+
"description": "a valid date-time with a leap second, with minus offset",
63+
"data": "1998-12-31T15:59:60.123-08:00",
64+
"valid": true
65+
},
66+
{
67+
"description": "an invalid date-time past leap second, UTC",
68+
"data": "1998-12-31T23:59:61Z",
69+
"valid": false
70+
},
71+
{
72+
"description": "an invalid date-time with leap second on a wrong minute, UTC",
73+
"data": "1998-12-31T23:58:60Z",
74+
"valid": false
75+
},
76+
{
77+
"description": "an invalid date-time with leap second on a wrong hour, UTC",
78+
"data": "1998-12-31T22:59:60Z",
79+
"valid": false
80+
},
81+
{
82+
"description": "an invalid day in date-time string",
83+
"data": "1990-02-31T15:59:59.123-08:00",
5984
"valid": false
6085
},
6186
{
6287
"description": "an invalid offset in date-time string",
63-
"data": "1990-12-31T15:59:60-24:00",
88+
"data": "1990-12-31T15:59:59-24:00",
6489
"valid": false
6590
},
6691
{

0 commit comments

Comments
 (0)