Skip to content

Commit e23ae02

Browse files
authored
Add tests for references and change in rules for draft 3 to 4 (#54)
1 parent 943afe2 commit e23ae02

27 files changed

+296
-3
lines changed

rules/from-draft3/to-draft4/013-type-has-objects-and-strings-in-its-array-initialize.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
{ "operation": "contains-type", "path": [ "type" ], "value": "string" }
88
],
99
"transform": [
10-
{ "operation": "add", "path": [ "anyOf", "-" ], "value": { "type": [] } }
10+
{ "operation": "add", "path": [ "anyOf", "-" ], "value": { "type": [] } },
11+
{ "operation": "add", "path": [ "type", "-" ], "value": true }
1112
]
1213
}

rules/from-draft3/to-draft4/014-type-has-objects-and-strings-in-its-array.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
{ "operation": "type-is", "path": [ "type", {} ], "value": "string" }
88
],
99
"transform": [
10-
{ "operation": "remove-and-append", "to": [ "anyOf", "-", "type" ], "from": [ "type", {} ] }
10+
{ "operation": "copy", "to": [ "anyOf", "-", "type", "-" ], "from": [ "type", {} ] }
1111
]
1212
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"vocabulary": "core",
3+
"condition": [
4+
{ "operation": "has-key", "path": [], "value": "type" },
5+
{ "operation": "type-is", "path": [ "type" ], "value": "array" },
6+
{ "operation": "contains-type", "path": [ "type" ], "value": "object" },
7+
{ "operation": "type-is", "path": [ "type", {} ], "value": "string" }
8+
],
9+
"transform": [
10+
{ "operation": "remove", "path": [ "type", {} ] }
11+
]
12+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"vocabulary": "core",
3+
"condition": [
4+
{ "operation": "has-key", "path": [], "value": "type" },
5+
{ "operation": "type-is", "path": [ "type" ], "value": "array" },
6+
{ "operation": "contains-type", "path": [ "type" ], "value": "boolean" }
7+
],
8+
"transform": [
9+
{ "operation": "remove", "path": [ "type" ] }
10+
]
11+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)