Skip to content

Commit 97954ad

Browse files
committed
Squashed 'json/' changes from 9251ebff1..78c888273
78c888273 Merge pull request #618 from json-schema-org/gregsdennis/contentschema-should-fail-content 5cbc53bc0 Merge pull request #613 from santhosh-tekuri/rjp-multidigit bb000ce98 Merge pull request #620 from json-schema-org/ether/remove-unused-remotes c4c490f1d Merge pull request #617 from json-schema-org/gregsdennis/dynamicAnchor-inside-propertyDependencies 0189831a9 remove schemas that are never referenced cf1b94249 Merge pull request #610 from handrews/rm-remotes d6490e817 move anchors into defs 2f9d117c0 Merge pull request #616 from json-schema-org/gregsdennis/propertyDependencies-and-unevaluated 4e5649cd0 move tests to draft-next a41f2f6c4 added type:object to contentSchema schemas 2f50e7864 add tests for $dynamicAnchor in multiple branches of propertyDependencies 4794a1991 add tests for unevaluatedProperties seeing inside propertyDependencies 27cc299f3 Add RJP test 'multi-digit integer prefix' 716b95d94 Merge pull request #612 from santhosh-tekuri/rjp-positive 320c804d1 Add RJP test 'explicit positive prefix' c8f210c39 Merge pull request #611 from santhosh-tekuri/time-alpha 3faeb222d add time test 'contains letters' 642441f2d Merge pull request #603 from santhosh-tekuri/uuid-nonstr 94d5043c7 add non-string uri tests 0c81374a2 Remove unneeded remotes 97a3e2156 Merge pull request #608 from json-schema-org/json-everything-uses-the-test-suite bdaf7e8be added json-everything to 'who uses' section of readme; removed manatee.json (deprecated) f00ec1008 Merge pull request #606 from santhosh-tekuri/duration-nounit 134480721 Merge pull request #607 from santhosh-tekuri/time-offsetprefix dd4538eee Test time format 'offset not starting with plus or minus' 80fe2db15 test duration format 'element without unit' 38ea15116 Merge pull request #604 from santhosh-tekuri/time-offset 613ec170e second fraction, not offset ee4bd4eb6 Add time format test with second fraction, no offset 86c2517cd Merge pull request #605 from santhosh-tekuri/rjp-empty cfe80006a Add relative-json-pointer test with empty string 31796b3b8 add non-string uuid tests git-subtree-dir: json git-subtree-split: 78c8882732bcdc2dad81cd7ce1e3f9bca6fb7a9d
1 parent 62e69b2 commit 97954ad

38 files changed

+539
-160
lines changed

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

remotes/draft-next/locationIndependentIdentifierDraft4.json

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

remotes/draft-next/locationIndependentIdentifierPre2019.json

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

remotes/draft-next/name.json

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

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

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

remotes/draft2019-09/locationIndependentIdentifierDraft4.json

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

remotes/draft2019-09/locationIndependentIdentifierPre2019.json

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

remotes/draft2019-09/name.json

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

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

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

remotes/draft2020-12/locationIndependentIdentifierDraft4.json

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

remotes/draft2020-12/locationIndependentIdentifierPre2019.json

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

remotes/draft2020-12/name.json

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

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

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

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
{

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
]

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
}

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
}

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
}

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)