generated from json-schema-org/repo-template
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add contains all the cases tests and rules respectively (#16)
I think I should further split the PR?
- Loading branch information
1 parent
7bba78a
commit 64082d8
Showing
16 changed files
with
332 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
rules/from-2019-09/to-2020-12/contains-with-maxContains-and-minContains-allOf-is-absent.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"vocabulary": [ | ||
"https://json-schema.org/draft/2019-09/vocab/applicator", | ||
"https://json-schema.org/draft/2019-09/vocab/validation" | ||
], | ||
"condition": [ | ||
{ "operation": "has-key", "path": [], "value": "contains" }, | ||
{ "operation": "has-key", "path": [], "value": "maxContains" }, | ||
{ "operation": "has-key", "path": [], "value": "minContains" }, | ||
{ "operation": "not-has-key", "path": [], "value": "allOf" } | ||
], | ||
"transform": [ | ||
{ "operation": "add", "path": [ "allOf" ], "value": [] }, | ||
{ "operation": "add", "path": [ "allOf" , "-"], "value": { "not": { "not": { "contains": "temp" } } } }, | ||
{ "operation": "move", "to": [ "allOf" , "-", "not", "not", "contains" ], "from": [ "contains" ] }, | ||
{ "operation": "move", "to": [ "allOf" , "-", "not", "not", "maxContains" ], "from": [ "maxContains" ] }, | ||
{ "operation": "move", "to": [ "allOf" , "-", "not", "not", "minContains" ], "from": [ "minContains" ] } | ||
] | ||
} |
18 changes: 18 additions & 0 deletions
18
...s/from-2019-09/to-2020-12/contains-with-maxContains-and-minContains-allOf-is-present.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"vocabulary": [ | ||
"https://json-schema.org/draft/2019-09/vocab/applicator", | ||
"https://json-schema.org/draft/2019-09/vocab/validation" | ||
], | ||
"condition": [ | ||
{ "operation": "has-key", "path": [], "value": "contains" }, | ||
{ "operation": "has-key", "path": [], "value": "maxContains" }, | ||
{ "operation": "has-key", "path": [], "value": "minContains" }, | ||
{ "operation": "has-key", "path": [], "value": "allOf" } | ||
], | ||
"transform": [ | ||
{ "operation": "add", "path": [ "allOf" , "-"], "value": { "not": { "not": { "contains": "temp" } } } }, | ||
{ "operation": "move", "to": [ "allOf" , "-", "not", "not", "contains" ], "from": [ "contains" ] }, | ||
{ "operation": "move", "to": [ "allOf" , "-", "not", "not", "maxContains" ], "from": [ "maxContains" ] }, | ||
{ "operation": "move", "to": [ "allOf" , "-", "not", "not", "minContains" ], "from": [ "minContains" ] } | ||
] | ||
} |
18 changes: 18 additions & 0 deletions
18
...2019-09/to-2020-12/contains-with-maxContains-and-without-minContains-allOf-is-absent.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"vocabulary": [ | ||
"https://json-schema.org/draft/2019-09/vocab/applicator", | ||
"https://json-schema.org/draft/2019-09/vocab/validation" | ||
], | ||
"condition": [ | ||
{ "operation": "has-key", "path": [], "value": "contains" }, | ||
{ "operation": "has-key", "path": [], "value": "maxContains" }, | ||
{ "operation": "not-has-key", "path": [], "value": "minContains" }, | ||
{ "operation": "not-has-key", "path": [], "value": "allOf" } | ||
], | ||
"transform": [ | ||
{ "operation": "add", "path": [ "allOf" ], "value": [] }, | ||
{ "operation": "add", "path": [ "allOf" , "-"], "value": { "not": { "not": { "contains": "temp" } } } }, | ||
{ "operation": "move", "to": [ "allOf" , "-", "not", "not", "contains" ], "from": [ "contains" ] }, | ||
{ "operation": "move", "to": [ "allOf" , "-", "not", "not", "maxContains" ], "from": [ "maxContains" ] } | ||
] | ||
} |
17 changes: 17 additions & 0 deletions
17
...019-09/to-2020-12/contains-with-maxContains-and-without-minContains-allOf-is-present.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"vocabulary": [ | ||
"https://json-schema.org/draft/2019-09/vocab/applicator", | ||
"https://json-schema.org/draft/2019-09/vocab/validation" | ||
], | ||
"condition": [ | ||
{ "operation": "has-key", "path": [], "value": "contains" }, | ||
{ "operation": "has-key", "path": [], "value": "maxContains" }, | ||
{ "operation": "not-has-key", "path": [], "value": "minContains" }, | ||
{ "operation": "has-key", "path": [], "value": "allOf" } | ||
], | ||
"transform": [ | ||
{ "operation": "add", "path": [ "allOf" , "-"], "value": { "not": { "not": { "contains": "temp" } } } }, | ||
{ "operation": "move", "to": [ "allOf" , "-", "not", "not", "contains" ], "from": [ "contains" ] }, | ||
{ "operation": "move", "to": [ "allOf" , "-", "not", "not", "maxContains" ], "from": [ "maxContains" ] } | ||
] | ||
} |
18 changes: 18 additions & 0 deletions
18
...2019-09/to-2020-12/contains-with-minContains-and-without-maxContains-allOf-is-absent.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"vocabulary": [ | ||
"https://json-schema.org/draft/2019-09/vocab/applicator", | ||
"https://json-schema.org/draft/2019-09/vocab/validation" | ||
], | ||
"condition": [ | ||
{ "operation": "has-key", "path": [], "value": "contains" }, | ||
{ "operation": "has-key", "path": [], "value": "minContains" }, | ||
{ "operation": "not-has-key", "path": [], "value": "maxContains" }, | ||
{ "operation": "not-has-key", "path": [], "value": "allOf" } | ||
], | ||
"transform": [ | ||
{ "operation": "add", "path": [ "allOf" ], "value": [] }, | ||
{ "operation": "add", "path": [ "allOf" , "-"], "value": { "not": { "not": { "contains": "temp" } } } }, | ||
{ "operation": "move", "to": [ "allOf" , "-", "not", "not", "contains" ], "from": [ "contains" ] }, | ||
{ "operation": "move", "to": [ "allOf" , "-", "not", "not", "minContains" ], "from": [ "minContains" ] } | ||
] | ||
} |
17 changes: 17 additions & 0 deletions
17
...019-09/to-2020-12/contains-with-minContains-and-without-maxContains-allOf-is-present.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"vocabulary": [ | ||
"https://json-schema.org/draft/2019-09/vocab/applicator", | ||
"https://json-schema.org/draft/2019-09/vocab/validation" | ||
], | ||
"condition": [ | ||
{ "operation": "has-key", "path": [], "value": "contains" }, | ||
{ "operation": "has-key", "path": [], "value": "minContains" }, | ||
{ "operation": "not-has-key", "path": [], "value": "maxContains" }, | ||
{ "operation": "has-key", "path": [], "value": "allOf" } | ||
], | ||
"transform": [ | ||
{ "operation": "add", "path": [ "allOf" , "-"], "value": { "not": { "not": { "contains": "temp" } } } }, | ||
{ "operation": "move", "to": [ "allOf" , "-", "not", "not", "contains" ], "from": [ "contains" ] }, | ||
{ "operation": "move", "to": [ "allOf" , "-", "not", "not", "minContains" ], "from": [ "minContains" ] } | ||
] | ||
} |
17 changes: 17 additions & 0 deletions
17
...2019-09/to-2020-12/contains-without-both-maxContains-and-minContains-allOf-is-absent.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"vocabulary": [ | ||
"https://json-schema.org/draft/2019-09/vocab/applicator", | ||
"https://json-schema.org/draft/2019-09/vocab/validation" | ||
], | ||
"condition": [ | ||
{ "operation": "has-key", "path": [], "value": "contains" }, | ||
{ "operation": "not-has-key", "path": [], "value": "minContains" }, | ||
{ "operation": "not-has-key", "path": [], "value": "maxContains" }, | ||
{ "operation": "not-has-key", "path": [], "value": "allOf" } | ||
], | ||
"transform": [ | ||
{ "operation": "add", "path": [ "allOf" ], "value": [] }, | ||
{ "operation": "add", "path": [ "allOf" , "-"], "value": { "not": { "not": { "contains": "temp" } } } }, | ||
{ "operation": "move", "to": [ "allOf" , "-", "not", "not", "contains" ], "from": [ "contains" ] } | ||
] | ||
} |
16 changes: 16 additions & 0 deletions
16
...019-09/to-2020-12/contains-without-both-maxContains-and-minContains-allOf-is-present.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"vocabulary": [ | ||
"https://json-schema.org/draft/2019-09/vocab/applicator", | ||
"https://json-schema.org/draft/2019-09/vocab/validation" | ||
], | ||
"condition": [ | ||
{ "operation": "has-key", "path": [], "value": "contains" }, | ||
{ "operation": "not-has-key", "path": [], "value": "minContains" }, | ||
{ "operation": "not-has-key", "path": [], "value": "maxContains" }, | ||
{ "operation": "has-key", "path": [], "value": "allOf" } | ||
], | ||
"transform": [ | ||
{ "operation": "add", "path": [ "allOf" , "-"], "value": { "not": { "not": { "contains": "temp" } } } }, | ||
{ "operation": "move", "to": [ "allOf" , "-", "not", "not", "contains" ], "from": [ "contains" ] } | ||
] | ||
} |
25 changes: 25 additions & 0 deletions
25
test/from-2019-09/to-2020-12/contains-with-maxContains-and-minContains-allOf-is-absent.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
[ | ||
{ | ||
"title": "`contains` keyword having schema with maxContains and minContains, allOf is absent", | ||
"from": { | ||
"contains": { "type": "string" }, | ||
"maxContains": 2, | ||
"minContains": 1, | ||
"unevaluatedItems": false | ||
}, | ||
"to": { | ||
"allOf": [ | ||
{ | ||
"not": { | ||
"not": { | ||
"contains": { "type": "string" }, | ||
"maxContains": 2, | ||
"minContains": 1 | ||
} | ||
} | ||
} | ||
], | ||
"unevaluatedItems": false | ||
} | ||
} | ||
] |
27 changes: 27 additions & 0 deletions
27
test/from-2019-09/to-2020-12/contains-with-maxContains-and-minContains-allOf-is-present.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
[ | ||
{ | ||
"title": "`contains` keyword having schema with maxContains and minContains, allOf is present", | ||
"from": { | ||
"contains": { "type": "string" }, | ||
"maxContains": 2, | ||
"minContains": 1, | ||
"unevaluatedItems": false, | ||
"allOf": [ {} ] | ||
}, | ||
"to": { | ||
"allOf": [ | ||
{}, | ||
{ | ||
"not": { | ||
"not": { | ||
"contains": { "type": "string" }, | ||
"maxContains": 2, | ||
"minContains": 1 | ||
} | ||
} | ||
} | ||
], | ||
"unevaluatedItems": false | ||
} | ||
} | ||
] |
23 changes: 23 additions & 0 deletions
23
...2019-09/to-2020-12/contains-with-maxContains-and-without-minContains-allOf-is-absent.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[ | ||
{ | ||
"title": "`contains` keyword having schema with maxContains and without minContains, allOf is absent", | ||
"from": { | ||
"contains": { "type": "string" }, | ||
"maxContains": 2, | ||
"unevaluatedItems": false | ||
}, | ||
"to": { | ||
"allOf": [ | ||
{ | ||
"not": { | ||
"not": { | ||
"contains": { "type": "string" }, | ||
"maxContains": 2 | ||
} | ||
} | ||
} | ||
], | ||
"unevaluatedItems": false | ||
} | ||
} | ||
] |
25 changes: 25 additions & 0 deletions
25
...019-09/to-2020-12/contains-with-maxContains-and-without-minContains-allOf-is-present.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
[ | ||
{ | ||
"title": "`contains` keyword having schema with maxContains and without minContains, allOf is present", | ||
"from": { | ||
"contains": { "type": "string" }, | ||
"maxContains": 2, | ||
"unevaluatedItems": false, | ||
"allOf": [ {} ] | ||
}, | ||
"to": { | ||
"allOf": [ | ||
{}, | ||
{ | ||
"not": { | ||
"not": { | ||
"contains": { "type": "string" }, | ||
"maxContains": 2 | ||
} | ||
} | ||
} | ||
], | ||
"unevaluatedItems": false | ||
} | ||
} | ||
] |
23 changes: 23 additions & 0 deletions
23
...2019-09/to-2020-12/contains-with-minContains-and-without-maxContains-allOf-is-absent.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[ | ||
{ | ||
"title": "`contains` keyword having schema with and minContains without maxContains, allOf is absent", | ||
"from": { | ||
"contains": { "type": "string" }, | ||
"minContains": 2, | ||
"unevaluatedItems": false | ||
}, | ||
"to": { | ||
"allOf": [ | ||
{ | ||
"not": { | ||
"not": { | ||
"contains": { "type": "string" }, | ||
"minContains": 2 | ||
} | ||
} | ||
} | ||
], | ||
"unevaluatedItems": false | ||
} | ||
} | ||
] |
25 changes: 25 additions & 0 deletions
25
...019-09/to-2020-12/contains-with-minContains-and-without-maxContains-allOf-is-present.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
[ | ||
{ | ||
"title": "`contains` keyword having schema with and minContains without maxContains, allOf is present", | ||
"from": { | ||
"contains": { "type": "string" }, | ||
"minContains": 2, | ||
"unevaluatedItems": false, | ||
"allOf": [ {} ] | ||
}, | ||
"to": { | ||
"allOf": [ | ||
{}, | ||
{ | ||
"not": { | ||
"not": { | ||
"contains": { "type": "string" }, | ||
"minContains": 2 | ||
} | ||
} | ||
} | ||
], | ||
"unevaluatedItems": false | ||
} | ||
} | ||
] |
21 changes: 21 additions & 0 deletions
21
...2019-09/to-2020-12/contains-without-both-maxContains-and-minContains-allOf-is-absent.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[ | ||
{ | ||
"title": "`contains` keyword having schema without both maxContains and minContains, allOf is absent", | ||
"from": { | ||
"contains": { "type": "string" }, | ||
"unevaluatedItems": false | ||
}, | ||
"to": { | ||
"allOf": [ | ||
{ | ||
"not": { | ||
"not": { | ||
"contains": { "type": "string" } | ||
} | ||
} | ||
} | ||
], | ||
"unevaluatedItems": false | ||
} | ||
} | ||
] |
23 changes: 23 additions & 0 deletions
23
...019-09/to-2020-12/contains-without-both-maxContains-and-minContains-allOf-is-present.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[ | ||
{ | ||
"title": "`contains` keyword having schema without both maxContains and minContains, allOf is present", | ||
"from": { | ||
"contains": { "type": "string" }, | ||
"unevaluatedItems": false, | ||
"allOf": [ {} ] | ||
}, | ||
"to": { | ||
"allOf": [ | ||
{}, | ||
{ | ||
"not": { | ||
"not": { | ||
"contains": { "type": "string" } | ||
} | ||
} | ||
} | ||
], | ||
"unevaluatedItems": false | ||
} | ||
} | ||
] |