Skip to content

Commit fb203a5

Browse files
committed
Merge commit '97954adeb0fbb3d4499580d897de507d3ab0d919'
* commit '97954adeb0fbb3d4499580d897de507d3ab0d919': Squashed 'json/' changes from 9251ebff1..78c888273
2 parents 46fdb98 + 97954ad commit fb203a5

38 files changed

+539
-160
lines changed

json/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,8 @@ Node-specific support is maintained in a [separate repository](https://github.co
283283

284284
### .NET
285285

286+
* [JsonSchema.Net](https://github.com/gregsdennis/json-everything)
286287
* [Newtonsoft.Json.Schema](https://github.com/JamesNK/Newtonsoft.Json.Schema)
287-
* [Manatee.Json](https://github.com/gregsdennis/Manatee.Json)
288288

289289
### Perl
290290

json/remotes/draft-next/locationIndependentIdentifierDraft4.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

json/remotes/draft-next/locationIndependentIdentifierPre2019.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

json/remotes/draft-next/name.json

Lines changed: 0 additions & 16 deletions
This file was deleted.

json/remotes/draft-next/ref-and-definitions.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

json/remotes/draft2019-09/locationIndependentIdentifierDraft4.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

json/remotes/draft2019-09/locationIndependentIdentifierPre2019.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

json/remotes/draft2019-09/name.json

Lines changed: 0 additions & 16 deletions
This file was deleted.

json/remotes/draft2019-09/ref-and-definitions.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

json/remotes/draft2020-12/locationIndependentIdentifierDraft4.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

json/remotes/draft2020-12/locationIndependentIdentifierPre2019.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

json/remotes/draft2020-12/name.json

Lines changed: 0 additions & 16 deletions
This file was deleted.

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

Lines changed: 0 additions & 12 deletions
This file was deleted.

json/tests/draft-next/content.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"$schema": "https://json-schema.org/draft/next/schema",
8484
"contentMediaType": "application/json",
8585
"contentEncoding": "base64",
86-
"contentSchema": { "required": ["foo"], "properties": { "foo": { "type": "string" } } }
86+
"contentSchema": { "type": "object", "required": ["foo"], "properties": { "foo": { "type": "string" } } }
8787
},
8888
"tests": [
8989
{

json/tests/draft-next/dynamicRef.json

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,5 +484,94 @@
484484
"valid": true
485485
}
486486
]
487+
},
488+
{
489+
"description": "$dynamicAnchor inside propertyDependencies",
490+
"schema": {
491+
"$schema": "https://json-schema.org/draft/2020-12/schema",
492+
"$id": "http://localhost:1234/draft2020-12/dynamicanchor-in-propertydependencies.json",
493+
"$defs": {
494+
"inner": {
495+
"$id": "inner",
496+
"$dynamicAnchor": "foo",
497+
"type": "object",
498+
"additionalProperties": {
499+
"$dynamicRef": "#foo"
500+
}
501+
}
502+
},
503+
"propertyDependencies": {
504+
"expectedTypes": {
505+
"strings": {
506+
"$id": "east",
507+
"$ref": "inner",
508+
"$defs": {
509+
"foo": {
510+
"$dynamicAnchor": "foo",
511+
"type": "string"
512+
}
513+
}
514+
},
515+
"integers": {
516+
"$id": "west",
517+
"$ref": "inner",
518+
"$defs": {
519+
"foo": {
520+
"$dynamicAnchor": "foo",
521+
"type": "integer"
522+
}
523+
}
524+
}
525+
}
526+
}
527+
},
528+
"tests": [
529+
{
530+
"description": "expected strings - additional property as string is valid",
531+
"data": {
532+
"expectedTypes": "strings",
533+
"anotherProperty": "also a string"
534+
},
535+
"valid": true
536+
},
537+
{
538+
"description": "expected strings - additional property as not string is invalid",
539+
"data": {
540+
"expectedTypes": "strings",
541+
"anotherProperty": 42
542+
},
543+
"valid": false
544+
},
545+
{
546+
"description": "expected integers - additional property as integer is valid",
547+
"data": {
548+
"expectedTypes": "integers",
549+
"anotherProperty": 42
550+
},
551+
"valid": true
552+
},
553+
{
554+
"description": "expected integers - additional property as not integer is invalid",
555+
"data": {
556+
"expectedTypes": "integers",
557+
"anotherProperty": "a string"
558+
},
559+
"valid": false
560+
},
561+
{
562+
"description": "expected missing - additional property as an object is valid",
563+
"data": {
564+
"anotherProperty": {}
565+
},
566+
"valid": true
567+
},
568+
{
569+
"description": "expected missing - additional property as not object is invalid",
570+
"data": {
571+
"anotherProperty": 42
572+
},
573+
"valid": false
574+
}
575+
]
487576
}
488577
]

json/tests/draft-next/optional/format/duration.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,11 @@
125125
"description": "invalid non-ASCII '২' (a Bengali 2)",
126126
"data": "P২Y",
127127
"valid": false
128+
},
129+
{
130+
"description": "element without unit",
131+
"data": "P1",
132+
"valid": false
128133
}
129134
]
130135
}

json/tests/draft-next/optional/format/relative-json-pointer.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@
6666
"data": "-1/foo/bar",
6767
"valid": false
6868
},
69+
{
70+
"description": "explicit positive prefix",
71+
"data": "+1/foo/bar",
72+
"valid": false
73+
},
6974
{
7075
"description": "## is not a valid json-pointer",
7176
"data": "0##",
@@ -80,6 +85,16 @@
8085
"description": "zero cannot be followed by other digits, plus octothorpe",
8186
"data": "01#",
8287
"valid": false
88+
},
89+
{
90+
"description": "empty string",
91+
"data": "",
92+
"valid": false
93+
},
94+
{
95+
"description": "multi-digit integer prefix",
96+
"data": "120/foo/bar",
97+
"valid": true
8398
}
8499
]
85100
}

json/tests/draft-next/optional/format/time.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,25 @@
191191
"data": "12:00:00",
192192
"valid": false
193193
},
194+
{
195+
"description": "no time offset with second fraction",
196+
"data": "12:00:00.52",
197+
"valid": false
198+
},
194199
{
195200
"description": "invalid non-ASCII '২' (a Bengali 2)",
196201
"data": "1২:00:00Z",
197202
"valid": false
203+
},
204+
{
205+
"description": "offset not starting with plus or minus",
206+
"data": "08:30:06#00:20",
207+
"valid": false
208+
},
209+
{
210+
"description": "contains letters",
211+
"data": "ab:cd:ef",
212+
"valid": false
198213
}
199214
]
200215
}

json/tests/draft-next/optional/format/uri.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,36 @@
66
"format": "uri"
77
},
88
"tests": [
9+
{
10+
"description": "all string formats ignore integers",
11+
"data": 12,
12+
"valid": true
13+
},
14+
{
15+
"description": "all string formats ignore floats",
16+
"data": 13.7,
17+
"valid": true
18+
},
19+
{
20+
"description": "all string formats ignore objects",
21+
"data": {},
22+
"valid": true
23+
},
24+
{
25+
"description": "all string formats ignore arrays",
26+
"data": [],
27+
"valid": true
28+
},
29+
{
30+
"description": "all string formats ignore booleans",
31+
"data": false,
32+
"valid": true
33+
},
34+
{
35+
"description": "all string formats ignore nulls",
36+
"data": null,
37+
"valid": true
38+
},
939
{
1040
"description": "a valid URL with anchor tag",
1141
"data": "http://foo.bar/?baz=qux#quux",

0 commit comments

Comments
 (0)