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.
- Loading branch information
1 parent
4056e3c
commit 7bcf16a
Showing
7 changed files
with
134 additions
and
0 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
rules/from-draft2/to-draft3/011-optional-true-in-properties-children.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": "properties" }, | ||
{ "operation": "has-key", "path": [ "properties", {} ], "value": "optional" }, | ||
{ "operation": "equals", "path": [ "properties", {}, "optional" ], "value": true } | ||
], | ||
"transform": [ | ||
{ "operation": "remove", "path": [ "properties", {}, "optional" ] } | ||
] | ||
} |
12 changes: 12 additions & 0 deletions
12
...from-draft2/to-draft3/012-optional-false-in-properties-children-and-required-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,12 @@ | ||
{ | ||
"vocabulary": "core", | ||
"condition": [ | ||
{ "operation": "has-key", "path": [], "value": "properties" }, | ||
{ "operation": "has-key", "path": [ "properties", {} ], "value": "optional" }, | ||
{ "operation": "equals", "path": [ "properties", {}, "optional" ], "value": false }, | ||
{ "operation": "has-key", "path": [ "properties", {} ], "value": "required" } | ||
], | ||
"transform": [ | ||
{ "operation": "prefix-until-unique", "path": [ "properties", {}, "required" ], "value": "x-" } | ||
] | ||
} |
13 changes: 13 additions & 0 deletions
13
rules/from-draft2/to-draft3/013-optional-false-in-properties-children.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": "properties" }, | ||
{ "operation": "has-key", "path": [ "properties", {} ], "value": "optional" }, | ||
{ "operation": "equals", "path": [ "properties", {}, "optional" ], "value": false }, | ||
{ "operation": "not-has-key", "path": [ "properties", {} ], "value": "required" } | ||
], | ||
"transform": [ | ||
{ "operation": "move", "to": [ "properties", {}, "required" ], "from": [ "properties", {}, "optional" ] }, | ||
{ "operation": "replace", "path": [ "properties", {}, "required" ], "value": true } | ||
] | ||
} |
10 changes: 10 additions & 0 deletions
10
...ft2/to-draft3/014-requires-is-present-in-properties-children-initialize-dependencies.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,10 @@ | ||
{ | ||
"vocabulary": "core", | ||
"condition": [ | ||
{ "operation": "has-key", "path": [], "value": "properties" }, | ||
{ "operation": "has-key", "path": [ "properties", {} ], "value": "requires" } | ||
], | ||
"transform": [ | ||
{ "operation": "add", "path": [ "dependencies" ], "value": {} } | ||
] | ||
} |
10 changes: 10 additions & 0 deletions
10
rules/from-draft2/to-draft3/015-requires-is-present-in-properties-children.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,10 @@ | ||
{ | ||
"vocabulary": "core", | ||
"condition": [ | ||
{ "operation": "has-key", "path": [], "value": "properties" }, | ||
{ "operation": "has-key", "path": [ "properties", {} ], "value": "requires" } | ||
], | ||
"transform": [ | ||
{ "operation": "move", "to": [ "dependencies", {} ], "from": [ "properties", {}, "requires" ] } | ||
] | ||
} |
53 changes: 53 additions & 0 deletions
53
test/from-draft2/to-draft3/optional-in-properties-children.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,53 @@ | ||
[ | ||
{ | ||
"title": "properties has children who have optional:false and required is already present", | ||
"from": { | ||
"properties": { | ||
"foo": { | ||
"required": "string", | ||
"optional": false | ||
} | ||
} | ||
}, | ||
"to": { | ||
"properties": { | ||
"foo": { | ||
"x-required": "string", | ||
"required": true | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"title": "properties has children who have optional:false", | ||
"from": { | ||
"properties": { | ||
"foo": { | ||
"optional": false | ||
} | ||
} | ||
}, | ||
"to": { | ||
"properties": { | ||
"foo": { | ||
"required": true | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"title": "properties has children who have optional:true", | ||
"from": { | ||
"properties": { | ||
"foo": { | ||
"optional": true | ||
} | ||
} | ||
}, | ||
"to": { | ||
"properties": { | ||
"foo": {} | ||
} | ||
} | ||
} | ||
] |
25 changes: 25 additions & 0 deletions
25
test/from-draft2/to-draft3/requires-is-present-in-properties-children.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": "properties has children who have `requires` keyword", | ||
"from": { | ||
"properties": { | ||
"foo": { | ||
"requires": "bar" | ||
}, | ||
"bar": { | ||
"requires": { "type": "string"} | ||
} | ||
} | ||
}, | ||
"to": { | ||
"properties": { | ||
"foo": {}, | ||
"bar": {} | ||
}, | ||
"dependencies": { | ||
"foo": "bar", | ||
"bar": { "type": "string"} | ||
} | ||
} | ||
} | ||
] |