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.
Transform
disallow
from Draft 3 to Draft 4 (#38)
- Loading branch information
1 parent
eb53154
commit 4861d7b
Showing
8 changed files
with
129 additions
and
0 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
rules/from-draft3/to-draft4/016-disallow-has-value-equals-any.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,11 @@ | ||
{ | ||
"vocabulary": "core", | ||
"condition": [ | ||
{ "operation": "has-key", "path": [], "value": "disallow" }, | ||
{ "operation": "equals", "path": [ "disallow" ], "value": "any" } | ||
], | ||
"transform": [ | ||
{ "operation": "add", "path": [ "not" ], "value": {} }, | ||
{ "operation": "remove", "path": [ "disallow" ] } | ||
] | ||
} |
11 changes: 11 additions & 0 deletions
11
rules/from-draft3/to-draft4/017-disallow-has-any-in-its-array.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,11 @@ | ||
{ | ||
"vocabulary": "core", | ||
"condition": [ | ||
{ "operation": "has-key", "path": [], "value": "disallow" }, | ||
{ "operation": "equals", "path": [ "disallow", {} ], "value": "any" } | ||
], | ||
"transform": [ | ||
{ "operation": "add", "path": [ "not" ], "value": {} }, | ||
{ "operation": "remove", "path": [ "disallow" ] } | ||
] | ||
} |
12 changes: 12 additions & 0 deletions
12
...m-draft3/to-draft4/018-disallow-has-atleast-one-object-in-its-array-initialize-allOf.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,12 @@ | ||
{ | ||
"vocabulary": "core", | ||
"condition": [ | ||
{ "operation": "has-key", "path": [], "value": "disallow" }, | ||
{ "operation": "not-has-key", "path": [], "value": "allOf" }, | ||
{ "operation": "type-is", "path": [ "disallow" ], "value": "array" }, | ||
{ "operation": "contains-type", "path": [ "disallow" ], "value": "object" } | ||
], | ||
"transform": [ | ||
{ "operation": "add", "path": [ "allOf" ], "value": [] } | ||
] | ||
} |
13 changes: 13 additions & 0 deletions
13
rules/from-draft3/to-draft4/019-disallow-has-atleast-one-object-in-its-array.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,13 @@ | ||
{ | ||
"vocabulary": "core", | ||
"condition": [ | ||
{ "operation": "has-key", "path": [], "value": "disallow" }, | ||
{ "operation": "has-key", "path": [], "value": "allOf" }, | ||
{ "operation": "type-is", "path": [ "disallow" ], "value": "array" }, | ||
{ "operation": "type-is", "path": [ "disallow", {} ], "value": "object" } | ||
], | ||
"transform": [ | ||
{ "operation": "add", "path": [ "allOf", "-" ], "value": { "not": "temp"} }, | ||
{ "operation": "move", "to": [ "allOf", "-", "not" ], "from": [ "disallow", {} ] } | ||
] | ||
} |
14 changes: 14 additions & 0 deletions
14
rules/from-draft3/to-draft4/020-disallow-is-an-array-of-strings-allOf-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,14 @@ | ||
{ | ||
"vocabulary": "core", | ||
"condition": [ | ||
{ "operation": "has-key", "path": [], "value": "disallow" }, | ||
{ "operation": "type-is", "path": [ "disallow" ], "value": "array" }, | ||
{ "operation": "contains-type", "path": [ "disallow" ], "value": "string" }, | ||
{ "operation": "has-key", "path": [], "value": "allOf" } | ||
], | ||
"transform": [ | ||
{ "operation": "add", "path": [ "allOf", "-" ], "value": { "not": "temp" } }, | ||
{ "operation": "add", "path": [ "allOf", "-", "not" ], "value": { "type": "temp" } }, | ||
{ "operation": "move", "to": [ "allOf", "-", "not", "type" ], "from": [ "disallow" ] } | ||
] | ||
} |
13 changes: 13 additions & 0 deletions
13
rules/from-draft3/to-draft4/021-disallow-is-an-array-of-strings-allOf-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,13 @@ | ||
{ | ||
"vocabulary": "core", | ||
"condition": [ | ||
{ "operation": "has-key", "path": [], "value": "disallow" }, | ||
{ "operation": "type-is", "path": [ "disallow" ], "value": "array" }, | ||
{ "operation": "contains-type", "path": [ "disallow" ], "value": "string" }, | ||
{ "operation": "not-has-key", "path": [], "value": "allOf" } | ||
], | ||
"transform": [ | ||
{ "operation": "add", "path": [ "allOf" ], "value": [ { "not": { "type": "temp" } } ] }, | ||
{ "operation": "move", "to": [ "allOf", "-", "not", "type" ], "from": [ "disallow" ] } | ||
] | ||
} |
11 changes: 11 additions & 0 deletions
11
rules/from-draft3/to-draft4/021-disallow-is-an-empty-array.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,11 @@ | ||
{ | ||
"vocabulary": "core", | ||
"condition": [ | ||
{ "operation": "has-key", "path": [], "value": "disallow" }, | ||
{ "operation": "type-is", "path": [ "disallow" ], "value": "array" }, | ||
{ "operation": "size-equals", "path": [ "disallow" ], "value": 0 } | ||
], | ||
"transform": [ | ||
{ "operation": "remove", "path": [ "disallow" ] } | ||
] | ||
} |
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,44 @@ | ||
[ | ||
{ | ||
"title": "`disallow` is present and value equals to any", | ||
"from": { | ||
"disallow": "any" | ||
}, | ||
"to": { | ||
"not": {} | ||
} | ||
}, | ||
{ | ||
"title": "`disallow` is present and contains `any` in it", | ||
"from": { | ||
"disallow": [ "any", {}, "string" ] | ||
}, | ||
"to": { | ||
"not": {} | ||
} | ||
}, | ||
{ | ||
"title": "`disallow` is present and contains atleast one object and allOf present", | ||
"from": { | ||
"disallow": [ {}, { "type": "string"} ], | ||
"allOf": [] | ||
}, | ||
"to": { | ||
"allOf": [ | ||
{ "not": { "type": "string"} }, | ||
{ "not": {} } | ||
] | ||
} | ||
}, | ||
{ | ||
"title": "`disallow` is present and is an array of strings", | ||
"from": { | ||
"disallow": [ "number", "string" ] | ||
}, | ||
"to": { | ||
"allOf": [ | ||
{ "not": { "type": [ "number", "string" ] } } | ||
] | ||
} | ||
} | ||
] |