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 rules and tests for excusive Maximum and Minimum draft 4 to 6
- Loading branch information
1 parent
7071521
commit 0b6c2ba
Showing
8 changed files
with
86 additions
and
0 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
rules/from-draft4/to-draft6/008-exclusiveMaximum-boolean-true.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": "validation", | ||
"condition": [ | ||
{ "operation": "has-key", "path": [], "value": "exclusiveMaximum" }, | ||
{ "operation": "equals", "path": [ "exclusiveMaximum" ], "value": true }, | ||
{ "operation": "has-key", "path": [], "value": "maximum" } | ||
], | ||
"transform": [ | ||
{ "operation": "copy", "to": [ "exclusiveMaximum" ], "from": [ "maximum" ] } | ||
] | ||
} |
10 changes: 10 additions & 0 deletions
10
rules/from-draft4/to-draft6/009-exclusiveMaximum-boolean-false.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": "validation", | ||
"condition": [ | ||
{ "operation": "has-key", "path": [], "value": "exclusiveMaximum" }, | ||
{ "operation": "equals", "path": [ "exclusiveMaximum" ], "value": false } | ||
], | ||
"transform": [ | ||
{ "operation": "remove", "path": [ "exclusiveMaximum" ] } | ||
] | ||
} |
11 changes: 11 additions & 0 deletions
11
rules/from-draft4/to-draft6/010-exclusiveMinimum-boolean-true.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": "validation", | ||
"condition": [ | ||
{ "operation": "has-key", "path": [], "value": "exclusiveMinimum" }, | ||
{ "operation": "equals", "path": [ "exclusiveMinimum" ], "value": true }, | ||
{ "operation": "has-key", "path": [], "value": "minimum" } | ||
], | ||
"transform": [ | ||
{ "operation": "copy", "to": [ "exclusiveMinimum" ], "from": [ "minimum" ] } | ||
] | ||
} |
10 changes: 10 additions & 0 deletions
10
rules/from-draft4/to-draft6/011-exclusiveMinimum-boolean-false.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": "validation", | ||
"condition": [ | ||
{ "operation": "has-key", "path": [], "value": "exclusiveMinimum" }, | ||
{ "operation": "equals", "path": [ "exclusiveMinimum" ], "value": false } | ||
], | ||
"transform": [ | ||
{ "operation": "remove", "path": [ "exclusiveMinimum" ] } | ||
] | ||
} |
9 changes: 9 additions & 0 deletions
9
test/from-draft4/to-draft6/exclusiveMaximum-boolean-false.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,9 @@ | ||
[ | ||
{ | ||
"title": "exclusiveMaximum present in the schema and value equals false", | ||
"from": { | ||
"exclusiveMaximum": false | ||
}, | ||
"to": {} | ||
} | ||
] |
13 changes: 13 additions & 0 deletions
13
test/from-draft4/to-draft6/exclusiveMaximum-boolean-true.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 @@ | ||
[ | ||
{ | ||
"title": "exclusiveMaximum and maximum present in the schema and exclusiveMaximum equals true", | ||
"from": { | ||
"exclusiveMaximum": true, | ||
"maximum": 3 | ||
}, | ||
"to": { | ||
"exclusiveMaximum": 3, | ||
"maximum": 3 | ||
} | ||
} | ||
] |
9 changes: 9 additions & 0 deletions
9
test/from-draft4/to-draft6/exclusiveMinimum-boolean-false.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,9 @@ | ||
[ | ||
{ | ||
"title": "exclusiveMinimum present in the schema and value equals false", | ||
"from": { | ||
"exclusiveMinimum": false | ||
}, | ||
"to": {} | ||
} | ||
] |
13 changes: 13 additions & 0 deletions
13
test/from-draft4/to-draft6/exclusiveMinimum-boolean-true.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 @@ | ||
[ | ||
{ | ||
"title": "exclusiveMinimum and minimum present in the schema and exclusiveMinimum equals true", | ||
"from": { | ||
"exclusiveMinimum": true, | ||
"minimum": 3 | ||
}, | ||
"to": { | ||
"exclusiveMinimum": 3, | ||
"minimum": 3 | ||
} | ||
} | ||
] |