additionalProperties.json revision 263646
1263646Sbapt[ 2263646Sbapt { 3263646Sbapt "description": 4263646Sbapt "additionalProperties being false does not allow other properties", 5263646Sbapt "schema": { 6263646Sbapt "properties": {"foo": {}, "bar": {}}, 7263646Sbapt "patternProperties": { "^v": {} }, 8263646Sbapt "additionalProperties": false 9263646Sbapt }, 10263646Sbapt "tests": [ 11263646Sbapt { 12263646Sbapt "description": "no additional properties is valid", 13263646Sbapt "data": {"foo": 1}, 14263646Sbapt "valid": true 15263646Sbapt }, 16263646Sbapt { 17263646Sbapt "description": "an additional property is invalid", 18263646Sbapt "data": {"foo" : 1, "bar" : 2, "quux" : "boom"}, 19263646Sbapt "valid": false 20263646Sbapt }, 21263646Sbapt { 22263646Sbapt "description": "ignores non-objects", 23263646Sbapt "data": [1, 2, 3], 24263646Sbapt "valid": true 25263646Sbapt }, 26263646Sbapt { 27263646Sbapt "description": "patternProperties are not additional properties", 28263646Sbapt "data": {"foo":1, "vroom": 2}, 29263646Sbapt "valid": true 30263646Sbapt } 31263646Sbapt ] 32263646Sbapt }, 33263646Sbapt { 34263646Sbapt "description": 35263646Sbapt "additionalProperties allows a schema which should validate", 36263646Sbapt "schema": { 37263646Sbapt "properties": {"foo": {}, "bar": {}}, 38263646Sbapt "additionalProperties": {"type": "boolean"} 39263646Sbapt }, 40263646Sbapt "tests": [ 41263646Sbapt { 42263646Sbapt "description": "no additional properties is valid", 43263646Sbapt "data": {"foo": 1}, 44263646Sbapt "valid": true 45263646Sbapt }, 46263646Sbapt { 47263646Sbapt "description": "an additional valid property is valid", 48263646Sbapt "data": {"foo" : 1, "bar" : 2, "quux" : true}, 49263646Sbapt "valid": true 50263646Sbapt }, 51263646Sbapt { 52263646Sbapt "description": "an additional invalid property is invalid", 53263646Sbapt "data": {"foo" : 1, "bar" : 2, "quux" : 12}, 54263646Sbapt "valid": false 55263646Sbapt } 56263646Sbapt ] 57263646Sbapt }, 58263646Sbapt { 59263646Sbapt "description": "additionalProperties are allowed by default", 60263646Sbapt "schema": {"properties": {"foo": {}, "bar": {}}}, 61263646Sbapt "tests": [ 62263646Sbapt { 63263646Sbapt "description": "additional properties are allowed", 64263646Sbapt "data": {"foo": 1, "bar": 2, "quux": true}, 65263646Sbapt "valid": true 66263646Sbapt } 67263646Sbapt ] 68263646Sbapt } 69263646Sbapt] 70