Skip to content

Commit

Permalink
Squashed 'json/' changes from 9251ebff1..78c888273
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Julian committed Nov 28, 2022
1 parent 62e69b2 commit 97954ad
Show file tree
Hide file tree
Showing 38 changed files with 539 additions and 160 deletions.
2 changes: 1 addition & 1 deletion 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 remotes/draft-next/locationIndependentIdentifierDraft4.json

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

2 changes: 1 addition & 1 deletion 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 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 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 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 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 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 97954ad

Please sign in to comment.