[ { "description": "not", "database": { "schemas": [ { "not": { "type": "integer" }, "$id": "not_0_0" } ] }, "tests": [ { "description": "allowed", "data": "foo", "valid": true, "schema_id": "not_0_0" }, { "description": "disallowed", "data": 1, "valid": false, "schema_id": "not_0_0" } ] }, { "description": "not multiple types", "database": { "schemas": [ { "not": { "type": [ "integer", "boolean" ] }, "$id": "not_1_0" } ] }, "tests": [ { "description": "valid", "data": "foo", "valid": true, "schema_id": "not_1_0" }, { "description": "mismatch", "data": 1, "valid": false, "schema_id": "not_1_0" }, { "description": "other mismatch", "data": true, "valid": false, "schema_id": "not_1_0" } ] }, { "description": "not more complex schema", "database": { "schemas": [ { "not": { "type": "object", "properties": { "foo": { "type": "string" } } }, "extensible": true, "$id": "not_2_0" } ] }, "tests": [ { "description": "match", "data": 1, "valid": true, "schema_id": "not_2_0" }, { "description": "other match", "data": { "foo": 1 }, "valid": true, "schema_id": "not_2_0" }, { "description": "mismatch", "data": { "foo": "bar" }, "valid": false, "schema_id": "not_2_0" } ] }, { "description": "forbidden property", "database": { "schemas": [ { "properties": { "foo": { "not": {} } }, "$id": "not_3_0" } ] }, "tests": [ { "description": "property present", "data": { "foo": 1, "bar": 2 }, "valid": false, "schema_id": "not_3_0" }, { "description": "empty object is valid", "data": {}, "valid": true, "schema_id": "not_3_0" } ] }, { "description": "forbid everything with empty schema", "database": { "schemas": [ { "not": {}, "$id": "not_4_0" } ] }, "tests": [ { "description": "number is invalid", "data": 1, "valid": false, "schema_id": "not_4_0" }, { "description": "string is invalid", "data": "foo", "valid": false, "schema_id": "not_4_0" }, { "description": "boolean true is invalid", "data": true, "valid": false, "schema_id": "not_4_0" }, { "description": "boolean false is invalid", "data": false, "valid": false, "schema_id": "not_4_0" }, { "description": "null is invalid", "data": null, "valid": false, "schema_id": "not_4_0" }, { "description": "object is invalid", "data": { "foo": "bar" }, "valid": false, "schema_id": "not_4_0" }, { "description": "empty object is invalid", "data": {}, "valid": false, "schema_id": "not_4_0" }, { "description": "array is invalid", "data": [ "foo" ], "valid": false, "schema_id": "not_4_0" }, { "description": "empty array is invalid", "data": [], "valid": false, "schema_id": "not_4_0" } ] }, { "description": "forbid everything with boolean schema true", "database": { "schemas": [ { "not": true, "$id": "not_5_0" } ] }, "tests": [ { "description": "number is invalid", "data": 1, "valid": false, "schema_id": "not_5_0" }, { "description": "string is invalid", "data": "foo", "valid": false, "schema_id": "not_5_0" }, { "description": "boolean true is invalid", "data": true, "valid": false, "schema_id": "not_5_0" }, { "description": "boolean false is invalid", "data": false, "valid": false, "schema_id": "not_5_0" }, { "description": "null is invalid", "data": null, "valid": false, "schema_id": "not_5_0" }, { "description": "object is invalid", "data": { "foo": "bar" }, "valid": false, "schema_id": "not_5_0" }, { "description": "empty object is invalid", "data": {}, "valid": false, "schema_id": "not_5_0" }, { "description": "array is invalid", "data": [ "foo" ], "valid": false, "schema_id": "not_5_0" }, { "description": "empty array is invalid", "data": [], "valid": false, "schema_id": "not_5_0" } ] }, { "description": "allow everything with boolean schema false", "database": { "schemas": [ { "not": false, "extensible": true, "$id": "not_6_0" } ] }, "tests": [ { "description": "number is valid", "data": 1, "valid": true, "schema_id": "not_6_0" }, { "description": "string is valid", "data": "foo", "valid": true, "schema_id": "not_6_0" }, { "description": "boolean true is valid", "data": true, "valid": true, "schema_id": "not_6_0" }, { "description": "boolean false is valid", "data": false, "valid": true, "schema_id": "not_6_0" }, { "description": "null is valid", "data": null, "valid": true, "schema_id": "not_6_0" }, { "description": "object is valid", "data": { "foo": "bar" }, "valid": true, "schema_id": "not_6_0" }, { "description": "empty object is valid", "data": {}, "valid": true, "schema_id": "not_6_0" }, { "description": "array is valid", "data": [ "foo" ], "valid": true, "schema_id": "not_6_0" }, { "description": "empty array is valid", "data": [], "valid": true, "schema_id": "not_6_0" } ] }, { "description": "double negation", "database": { "schemas": [ { "not": { "not": {} }, "$id": "not_7_0" } ] }, "tests": [ { "description": "any value is valid", "data": "foo", "valid": true, "schema_id": "not_7_0" } ] }, { "description": "extensible: true allows extra properties in not", "database": { "schemas": [ { "not": { "type": "integer" }, "extensible": true, "$id": "not_8_0" } ] }, "tests": [ { "description": "extra property is valid (not integer matches)", "data": { "foo": 1 }, "valid": true, "schema_id": "not_8_0" } ] }, { "description": "extensible: false (default) forbids extra properties in not", "database": { "schemas": [ { "not": { "type": "integer" }, "$id": "not_9_0" } ] }, "tests": [ { "description": "extra property is invalid due to strictness", "data": { "foo": 1 }, "valid": false, "schema_id": "not_9_0" } ] }, { "description": "property next to not (extensible: true)", "database": { "schemas": [ { "properties": { "bar": { "type": "string" } }, "not": { "type": "integer" }, "extensible": true, "$id": "not_10_0" } ] }, "tests": [ { "description": "extra property allowed", "data": { "bar": "baz", "foo": 1 }, "valid": true, "schema_id": "not_10_0" } ] }, { "description": "property next to not (extensible: false)", "database": { "schemas": [ { "properties": { "bar": { "type": "string" } }, "not": { "type": "integer" }, "$id": "not_11_0" } ] }, "tests": [ { "description": "extra property forbidden", "data": { "bar": "baz", "foo": 1 }, "valid": false, "schema_id": "not_11_0" }, { "description": "defined property allowed", "data": { "bar": "baz" }, "valid": true, "schema_id": "not_11_0" } ] } ]