Skip to content

Commit

Permalink
Merge commit '97954adeb0fbb3d4499580d897de507d3ab0d919'
Browse files Browse the repository at this point in the history
* commit '97954adeb0fbb3d4499580d897de507d3ab0d919':
  Squashed 'json/' changes from 9251ebff1..78c888273
  • Loading branch information
Julian committed Nov 28, 2022
2 parents 46fdb98 + 97954ad commit fb203a5
Show file tree
Hide file tree
Showing 38 changed files with 539 additions and 160 deletions.
2 changes: 1 addition & 1 deletion json/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,8 @@ Node-specific support is maintained in a [separate repository](https://github.co

### .NET

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

### Perl

Expand Down
12 changes: 0 additions & 12 deletions json/remotes/draft-next/locationIndependentIdentifierDraft4.json

This file was deleted.

12 changes: 0 additions & 12 deletions json/remotes/draft-next/locationIndependentIdentifierPre2019.json

This file was deleted.

16 changes: 0 additions & 16 deletions json/remotes/draft-next/name.json

This file was deleted.

12 changes: 0 additions & 12 deletions json/remotes/draft-next/ref-and-definitions.json

This file was deleted.

12 changes: 0 additions & 12 deletions json/remotes/draft2019-09/locationIndependentIdentifierDraft4.json

This file was deleted.

This file was deleted.

16 changes: 0 additions & 16 deletions json/remotes/draft2019-09/name.json

This file was deleted.

12 changes: 0 additions & 12 deletions json/remotes/draft2019-09/ref-and-definitions.json

This file was deleted.

12 changes: 0 additions & 12 deletions json/remotes/draft2020-12/locationIndependentIdentifierDraft4.json

This file was deleted.

This file was deleted.

16 changes: 0 additions & 16 deletions json/remotes/draft2020-12/name.json

This file was deleted.

12 changes: 0 additions & 12 deletions json/remotes/draft2020-12/ref-and-definitions.json

This file was deleted.

2 changes: 1 addition & 1 deletion json/tests/draft-next/content.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"$schema": "https://json-schema.org/draft/next/schema",
"contentMediaType": "application/json",
"contentEncoding": "base64",
"contentSchema": { "required": ["foo"], "properties": { "foo": { "type": "string" } } }
"contentSchema": { "type": "object", "required": ["foo"], "properties": { "foo": { "type": "string" } } }
},
"tests": [
{
Expand Down
89 changes: 89 additions & 0 deletions json/tests/draft-next/dynamicRef.json
Original file line number Diff line number Diff line change
Expand Up @@ -484,5 +484,94 @@
"valid": true
}
]
},
{
"description": "$dynamicAnchor inside propertyDependencies",
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "http://localhost:1234/draft2020-12/dynamicanchor-in-propertydependencies.json",
"$defs": {
"inner": {
"$id": "inner",
"$dynamicAnchor": "foo",
"type": "object",
"additionalProperties": {
"$dynamicRef": "#foo"
}
}
},
"propertyDependencies": {
"expectedTypes": {
"strings": {
"$id": "east",
"$ref": "inner",
"$defs": {
"foo": {
"$dynamicAnchor": "foo",
"type": "string"
}
}
},
"integers": {
"$id": "west",
"$ref": "inner",
"$defs": {
"foo": {
"$dynamicAnchor": "foo",
"type": "integer"
}
}
}
}
}
},
"tests": [
{
"description": "expected strings - additional property as string is valid",
"data": {
"expectedTypes": "strings",
"anotherProperty": "also a string"
},
"valid": true
},
{
"description": "expected strings - additional property as not string is invalid",
"data": {
"expectedTypes": "strings",
"anotherProperty": 42
},
"valid": false
},
{
"description": "expected integers - additional property as integer is valid",
"data": {
"expectedTypes": "integers",
"anotherProperty": 42
},
"valid": true
},
{
"description": "expected integers - additional property as not integer is invalid",
"data": {
"expectedTypes": "integers",
"anotherProperty": "a string"
},
"valid": false
},
{
"description": "expected missing - additional property as an object is valid",
"data": {
"anotherProperty": {}
},
"valid": true
},
{
"description": "expected missing - additional property as not object is invalid",
"data": {
"anotherProperty": 42
},
"valid": false
}
]
}
]
5 changes: 5 additions & 0 deletions json/tests/draft-next/optional/format/duration.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@
"description": "invalid non-ASCII '২' (a Bengali 2)",
"data": "P২Y",
"valid": false
},
{
"description": "element without unit",
"data": "P1",
"valid": false
}
]
}
Expand Down
15 changes: 15 additions & 0 deletions json/tests/draft-next/optional/format/relative-json-pointer.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@
"data": "-1/foo/bar",
"valid": false
},
{
"description": "explicit positive prefix",
"data": "+1/foo/bar",
"valid": false
},
{
"description": "## is not a valid json-pointer",
"data": "0##",
Expand All @@ -80,6 +85,16 @@
"description": "zero cannot be followed by other digits, plus octothorpe",
"data": "01#",
"valid": false
},
{
"description": "empty string",
"data": "",
"valid": false
},
{
"description": "multi-digit integer prefix",
"data": "120/foo/bar",
"valid": true
}
]
}
Expand Down
15 changes: 15 additions & 0 deletions json/tests/draft-next/optional/format/time.json
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,25 @@
"data": "12:00:00",
"valid": false
},
{
"description": "no time offset with second fraction",
"data": "12:00:00.52",
"valid": false
},
{
"description": "invalid non-ASCII '২' (a Bengali 2)",
"data": "1২:00:00Z",
"valid": false
},
{
"description": "offset not starting with plus or minus",
"data": "08:30:06#00:20",
"valid": false
},
{
"description": "contains letters",
"data": "ab:cd:ef",
"valid": false
}
]
}
Expand Down
30 changes: 30 additions & 0 deletions json/tests/draft-next/optional/format/uri.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,36 @@
"format": "uri"
},
"tests": [
{
"description": "all string formats ignore integers",
"data": 12,
"valid": true
},
{
"description": "all string formats ignore floats",
"data": 13.7,
"valid": true
},
{
"description": "all string formats ignore objects",
"data": {},
"valid": true
},
{
"description": "all string formats ignore arrays",
"data": [],
"valid": true
},
{
"description": "all string formats ignore booleans",
"data": false,
"valid": true
},
{
"description": "all string formats ignore nulls",
"data": null,
"valid": true
},
{
"description": "a valid URL with anchor tag",
"data": "http://foo.bar/?baz=qux#quux",
Expand Down
Loading

0 comments on commit fb203a5

Please sign in to comment.