Skip to content

Commit

Permalink
Squashed 'json/' changes from e42e8417b..d40b3e62f
Browse files Browse the repository at this point in the history
d40b3e62f Fix two remaining future-keywords tests in draft 4.
c23c720a2 Merge branch 'ether/unrecognized-keywords'
ea68a4ffd Move the future keywords tests to optional.
900695b74 squash: add $schema keyword to be clear that strict conformance is requested
acfd00c6f squash: contains does not exist in draft4
f506651a6 squash: fix minContains
b666c2023 sq - add $dynamic*, prefixItems to drafts 4,6,7 as well and fix keyword name
d14242e6e squash: fix test names
f1efe00df squash: $defs - definitions
c295358e7 squash: remove tests of $anchor and $ref
9defa7720 squash: add prefixItems: another new 2020-0X keyword
ebb359df5 squash: add $recursiveRef tests from #391
90bd7fb20 squash - fix 2019-09 future-keywords
e8e64efa1 very basic test of $dynamicRef
6c0272091 rename files to future-keywords.json
cb064e960 some tests for keywords added in later drafts

git-subtree-dir: json
git-subtree-split: d40b3e62f3156c576d7b8fad1afc3615c885ac67
  • Loading branch information
Julian committed Jun 16, 2022
1 parent fdf8268 commit 4f9cd0e
Show file tree
Hide file tree
Showing 4 changed files with 1,518 additions and 0 deletions.
80 changes: 80 additions & 0 deletions tests/draft2019-09/optional/future-keywords.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
[
{
"description": "$dynamicRef without $dynamicAnchor works like $ref",
"schema": {
"$schema": "https://json-schema.org/draft/2019-09/schema",
"properties": {
"foo": {"$dynamicRef": "#"}
},
"additionalProperties": false
},
"tests": [
{
"description": "match",
"data": {"foo": false},
"valid": true
},
{
"description": "recursive match",
"data": {"foo": {"foo": false}},
"valid": true
},
{
"description": "mismatch",
"data": {"bar": false},
"valid": false
},
{
"description": "recursive mismatch (but $dynamicRef is ignored)",
"data": {"foo": {"bar": false}},
"valid": true
}
]
},
{
"description": "prefixItems: an array of schemas for items",
"schema": {
"$schema": "https://json-schema.org/draft/2019-09/schema",
"prefixItems": [
{"type": "integer"},
{"type": "string"}
]
},
"tests": [
{
"description": "correct types",
"data": [ 1, "foo" ],
"valid": true
},
{
"description": "wrong types",
"data": [ "foo", 1 ],
"valid": true
},
{
"description": "incomplete array of items",
"data": [ 1 ],
"valid": true
},
{
"description": "array with additional items",
"data": [ 1, "foo", true ],
"valid": true
},
{
"description": "empty array",
"data": [ ],
"valid": true
},
{
"description": "JavaScript pseudo-array is valid",
"data": {
"0": "invalid",
"1": "valid",
"length": 2
},
"valid": true
}
]
}
]
Loading

0 comments on commit 4f9cd0e

Please sign in to comment.