uniqueItems.json revision 263646
1263646Sbapt[ 2263646Sbapt { 3263646Sbapt "description": "uniqueItems validation", 4263646Sbapt "schema": {"uniqueItems": true}, 5263646Sbapt "tests": [ 6263646Sbapt { 7263646Sbapt "description": "unique array of integers is valid", 8263646Sbapt "data": [1, 2], 9263646Sbapt "valid": true 10263646Sbapt }, 11263646Sbapt { 12263646Sbapt "description": "non-unique array of integers is invalid", 13263646Sbapt "data": [1, 1], 14263646Sbapt "valid": false 15263646Sbapt }, 16263646Sbapt { 17263646Sbapt "description": "numbers are unique if mathematically unequal", 18263646Sbapt "data": [1.0, 1.00, 1], 19263646Sbapt "valid": false 20263646Sbapt }, 21263646Sbapt { 22263646Sbapt "description": "unique array of objects is valid", 23263646Sbapt "data": [{"foo": "bar"}, {"foo": "baz"}], 24263646Sbapt "valid": true 25263646Sbapt }, 26263646Sbapt { 27263646Sbapt "description": "non-unique array of objects is invalid", 28263646Sbapt "data": [{"foo": "bar"}, {"foo": "bar"}], 29263646Sbapt "valid": false 30263646Sbapt }, 31263646Sbapt { 32263646Sbapt "description": "unique array of nested objects is valid", 33263646Sbapt "data": [ 34263646Sbapt {"foo": {"bar" : {"baz" : true}}}, 35263646Sbapt {"foo": {"bar" : {"baz" : false}}} 36263646Sbapt ], 37263646Sbapt "valid": true 38263646Sbapt }, 39263646Sbapt { 40263646Sbapt "description": "non-unique array of nested objects is invalid", 41263646Sbapt "data": [ 42263646Sbapt {"foo": {"bar" : {"baz" : true}}}, 43263646Sbapt {"foo": {"bar" : {"baz" : true}}} 44263646Sbapt ], 45263646Sbapt "valid": false 46263646Sbapt }, 47263646Sbapt { 48263646Sbapt "description": "unique array of arrays is valid", 49263646Sbapt "data": [["foo"], ["bar"]], 50263646Sbapt "valid": true 51263646Sbapt }, 52263646Sbapt { 53263646Sbapt "description": "non-unique array of arrays is invalid", 54263646Sbapt "data": [["foo"], ["foo"]], 55263646Sbapt "valid": false 56263646Sbapt }, 57263646Sbapt { 58263646Sbapt "description": "1 and true are unique", 59263646Sbapt "data": [1, true], 60263646Sbapt "valid": true 61263646Sbapt }, 62263646Sbapt { 63263646Sbapt "description": "0 and false are unique", 64263646Sbapt "data": [0, false], 65263646Sbapt "valid": true 66263646Sbapt }, 67263646Sbapt { 68263646Sbapt "description": "unique heterogeneous types are valid", 69263646Sbapt "data": [{}, [1], true, null, 1], 70263646Sbapt "valid": true 71263646Sbapt }, 72263646Sbapt { 73263646Sbapt "description": "non-unique heterogeneous types are invalid", 74263646Sbapt "data": [{}, [1], true, null, {}, 1], 75263646Sbapt "valid": false 76263646Sbapt } 77263646Sbapt ] 78263646Sbapt } 79263646Sbapt] 80