1268896Sbapt[ 2268896Sbapt { 3268896Sbapt "description": "additionalItems as schema", 4268896Sbapt "schema": { 5268896Sbapt "items": [{}], 6268896Sbapt "additionalItems": {"type": "integer"} 7268896Sbapt }, 8268896Sbapt "tests": [ 9268896Sbapt { 10268896Sbapt "description": "additional items match schema", 11268896Sbapt "data": [ null, 2, 3, 4 ], 12268896Sbapt "valid": true 13268896Sbapt }, 14268896Sbapt { 15268896Sbapt "description": "additional items do not match schema", 16268896Sbapt "data": [ null, 2, 3, "foo" ], 17268896Sbapt "valid": false 18268896Sbapt } 19268896Sbapt ] 20268896Sbapt }, 21268896Sbapt { 22268896Sbapt "description": "items is schema, no additionalItems", 23268896Sbapt "schema": { 24268896Sbapt "items": {}, 25268896Sbapt "additionalItems": false 26268896Sbapt }, 27268896Sbapt "tests": [ 28268896Sbapt { 29268896Sbapt "description": "all items match schema", 30268896Sbapt "data": [ 1, 2, 3, 4, 5 ], 31268896Sbapt "valid": true 32268896Sbapt } 33268896Sbapt ] 34268896Sbapt }, 35268896Sbapt { 36268896Sbapt "description": "array of items with no additionalItems", 37268896Sbapt "schema": { 38268896Sbapt "items": [{}, {}, {}], 39268896Sbapt "additionalItems": false 40268896Sbapt }, 41268896Sbapt "tests": [ 42268896Sbapt { 43268896Sbapt "description": "no additional items present", 44268896Sbapt "data": [ 1, 2, 3 ], 45268896Sbapt "valid": true 46268896Sbapt }, 47268896Sbapt { 48268896Sbapt "description": "additional items are not permitted", 49268896Sbapt "data": [ 1, 2, 3, 4 ], 50268896Sbapt "valid": false 51268896Sbapt } 52268896Sbapt ] 53268896Sbapt }, 54268896Sbapt { 55268896Sbapt "description": "additionalItems as false without items", 56268896Sbapt "schema": {"additionalItems": false}, 57268896Sbapt "tests": [ 58268896Sbapt { 59268896Sbapt "description": 60268896Sbapt "items defaults to empty schema so everything is valid", 61268896Sbapt "data": [ 1, 2, 3, 4, 5 ], 62268896Sbapt "valid": true 63268896Sbapt }, 64268896Sbapt { 65268896Sbapt "description": "ignores non-arrays", 66268896Sbapt "data": {"foo" : "bar"}, 67268896Sbapt "valid": true 68268896Sbapt } 69268896Sbapt ] 70268896Sbapt }, 71268896Sbapt { 72268896Sbapt "description": "additionalItems are allowed by default", 73268896Sbapt "schema": {"items": [{"type": "integer"}]}, 74268896Sbapt "tests": [ 75268896Sbapt { 76268896Sbapt "description": "only the first item is validated", 77268896Sbapt "data": [1, "foo", false], 78268896Sbapt "valid": true 79268896Sbapt } 80268896Sbapt ] 81268896Sbapt } 82268896Sbapt] 83