diff --git a/tests/draft3/additionalItems.json b/tests/draft3/additionalItems.json new file mode 100644 index 00000000..72ea449a --- /dev/null +++ b/tests/draft3/additionalItems.json @@ -0,0 +1,61 @@ +[ + { + "description": "additionalItems as schema", + "schema": { + "additionalItems": {"type": "integer"} + }, + "tests": [ + { + "description": "all items match schema", + "data": [ 1, 2, 3, 4.5, 5 ], + "valid": true + } + ] + }, + { + "description": "items is schema, no additionalItems", + "schema": { + "items": {}, + "additionalItems": false + }, + "tests": [ + { + "description": "all items match schema", + "data": [ 1, 2, 3, 4, 5 ], + "valid": true + } + ] + }, + { + "description": "array of items with no additionalItems", + "schema": { + "items": [{}, {}, {}], + "additionalItems": false + }, + "tests": [ + { + "description": "no additional items present", + "data": [ 1, 2, 3 ], + "valid": true + }, + { + "description": "additional items are not permitted", + "data": [ 1, 2, 3, 4 ], + "valid": false + } + ] + }, + { + "description": "additionalItems as false without items", + "schema": { + "additionalItems": false + }, + "tests": [ + { + "description": "items should allow anything", + "data": [ 1, 2, 3, 4, 5 ], + "valid": true + } + ] + } +] \ No newline at end of file diff --git a/tests/draft3/items.json b/tests/draft3/items.json new file mode 100644 index 00000000..9e162633 --- /dev/null +++ b/tests/draft3/items.json @@ -0,0 +1,41 @@ +[ + { + "description": "a schema given for items", + "schema": { + "items": {"type": "integer"} + }, + "tests": [ + { + "description": "valid items", + "data": [ 1, 2, 3 ], + "valid": true + }, + { + "description": "wrong type of items", + "data": [1, "x"], + "valid": false + } + ] + }, + { + "description": "an array of schemas for items", + "schema": { + "items": [ + {"type": "integer"}, + {"type": "string"} + ] + }, + "tests": [ + { + "description": "correct types", + "data": [ 1, "foo" ], + "valid": true + }, + { + "description": "wrong types", + "data": [ "foo", 1 ], + "valid": false + } + ] + } +] \ No newline at end of file