type.json revision 263646
1263646Sbapt[ 2263646Sbapt { 3263646Sbapt "description": "integer type matches integers", 4263646Sbapt "schema": {"type": "integer"}, 5263646Sbapt "tests": [ 6263646Sbapt { 7263646Sbapt "description": "an integer is an integer", 8263646Sbapt "data": 1, 9263646Sbapt "valid": true 10263646Sbapt }, 11263646Sbapt { 12263646Sbapt "description": "a float is not an integer", 13263646Sbapt "data": 1.1, 14263646Sbapt "valid": false 15263646Sbapt }, 16263646Sbapt { 17263646Sbapt "description": "a string is not an integer", 18263646Sbapt "data": "foo", 19263646Sbapt "valid": false 20263646Sbapt }, 21263646Sbapt { 22263646Sbapt "description": "an object is not an integer", 23263646Sbapt "data": {}, 24263646Sbapt "valid": false 25263646Sbapt }, 26263646Sbapt { 27263646Sbapt "description": "an array is not an integer", 28263646Sbapt "data": [], 29263646Sbapt "valid": false 30263646Sbapt }, 31263646Sbapt { 32263646Sbapt "description": "a boolean is not an integer", 33263646Sbapt "data": true, 34263646Sbapt "valid": false 35263646Sbapt }, 36263646Sbapt { 37263646Sbapt "description": "null is not an integer", 38263646Sbapt "data": null, 39263646Sbapt "valid": false 40263646Sbapt } 41263646Sbapt ] 42263646Sbapt }, 43263646Sbapt { 44263646Sbapt "description": "number type matches numbers", 45263646Sbapt "schema": {"type": "number"}, 46263646Sbapt "tests": [ 47263646Sbapt { 48263646Sbapt "description": "an integer is a number", 49263646Sbapt "data": 1, 50263646Sbapt "valid": true 51263646Sbapt }, 52263646Sbapt { 53263646Sbapt "description": "a float is a number", 54263646Sbapt "data": 1.1, 55263646Sbapt "valid": true 56263646Sbapt }, 57263646Sbapt { 58263646Sbapt "description": "a string is not a number", 59263646Sbapt "data": "foo", 60263646Sbapt "valid": false 61263646Sbapt }, 62263646Sbapt { 63263646Sbapt "description": "an object is not a number", 64263646Sbapt "data": {}, 65263646Sbapt "valid": false 66263646Sbapt }, 67263646Sbapt { 68263646Sbapt "description": "an array is not a number", 69263646Sbapt "data": [], 70263646Sbapt "valid": false 71263646Sbapt }, 72263646Sbapt { 73263646Sbapt "description": "a boolean is not a number", 74263646Sbapt "data": true, 75263646Sbapt "valid": false 76263646Sbapt }, 77263646Sbapt { 78263646Sbapt "description": "null is not a number", 79263646Sbapt "data": null, 80263646Sbapt "valid": false 81263646Sbapt } 82263646Sbapt ] 83263646Sbapt }, 84263646Sbapt { 85263646Sbapt "description": "string type matches strings", 86263646Sbapt "schema": {"type": "string"}, 87263646Sbapt "tests": [ 88263646Sbapt { 89263646Sbapt "description": "1 is not a string", 90263646Sbapt "data": 1, 91263646Sbapt "valid": false 92263646Sbapt }, 93263646Sbapt { 94263646Sbapt "description": "a float is not a string", 95263646Sbapt "data": 1.1, 96263646Sbapt "valid": false 97263646Sbapt }, 98263646Sbapt { 99263646Sbapt "description": "a string is a string", 100263646Sbapt "data": "foo", 101263646Sbapt "valid": true 102263646Sbapt }, 103263646Sbapt { 104263646Sbapt "description": "an object is not a string", 105263646Sbapt "data": {}, 106263646Sbapt "valid": false 107263646Sbapt }, 108263646Sbapt { 109263646Sbapt "description": "an array is not a string", 110263646Sbapt "data": [], 111263646Sbapt "valid": false 112263646Sbapt }, 113263646Sbapt { 114263646Sbapt "description": "a boolean is not a string", 115263646Sbapt "data": true, 116263646Sbapt "valid": false 117263646Sbapt }, 118263646Sbapt { 119263646Sbapt "description": "null is not a string", 120263646Sbapt "data": null, 121263646Sbapt "valid": false 122263646Sbapt } 123263646Sbapt ] 124263646Sbapt }, 125263646Sbapt { 126263646Sbapt "description": "object type matches objects", 127263646Sbapt "schema": {"type": "object"}, 128263646Sbapt "tests": [ 129263646Sbapt { 130263646Sbapt "description": "an integer is not an object", 131263646Sbapt "data": 1, 132263646Sbapt "valid": false 133263646Sbapt }, 134263646Sbapt { 135263646Sbapt "description": "a float is not an object", 136263646Sbapt "data": 1.1, 137263646Sbapt "valid": false 138263646Sbapt }, 139263646Sbapt { 140263646Sbapt "description": "a string is not an object", 141263646Sbapt "data": "foo", 142263646Sbapt "valid": false 143263646Sbapt }, 144263646Sbapt { 145263646Sbapt "description": "an object is an object", 146263646Sbapt "data": {}, 147263646Sbapt "valid": true 148263646Sbapt }, 149263646Sbapt { 150263646Sbapt "description": "an array is not an object", 151263646Sbapt "data": [], 152263646Sbapt "valid": false 153263646Sbapt }, 154263646Sbapt { 155263646Sbapt "description": "a boolean is not an object", 156263646Sbapt "data": true, 157263646Sbapt "valid": false 158263646Sbapt }, 159263646Sbapt { 160263646Sbapt "description": "null is not an object", 161263646Sbapt "data": null, 162263646Sbapt "valid": false 163263646Sbapt } 164263646Sbapt ] 165263646Sbapt }, 166263646Sbapt { 167263646Sbapt "description": "array type matches arrays", 168263646Sbapt "schema": {"type": "array"}, 169263646Sbapt "tests": [ 170263646Sbapt { 171263646Sbapt "description": "an integer is not an array", 172263646Sbapt "data": 1, 173263646Sbapt "valid": false 174263646Sbapt }, 175263646Sbapt { 176263646Sbapt "description": "a float is not an array", 177263646Sbapt "data": 1.1, 178263646Sbapt "valid": false 179263646Sbapt }, 180263646Sbapt { 181263646Sbapt "description": "a string is not an array", 182263646Sbapt "data": "foo", 183263646Sbapt "valid": false 184263646Sbapt }, 185263646Sbapt { 186263646Sbapt "description": "an object is not an array", 187263646Sbapt "data": {}, 188263646Sbapt "valid": false 189263646Sbapt }, 190263646Sbapt { 191263646Sbapt "description": "an array is not an array", 192263646Sbapt "data": [], 193263646Sbapt "valid": true 194263646Sbapt }, 195263646Sbapt { 196263646Sbapt "description": "a boolean is not an array", 197263646Sbapt "data": true, 198263646Sbapt "valid": false 199263646Sbapt }, 200263646Sbapt { 201263646Sbapt "description": "null is not an array", 202263646Sbapt "data": null, 203263646Sbapt "valid": false 204263646Sbapt } 205263646Sbapt ] 206263646Sbapt }, 207263646Sbapt { 208263646Sbapt "description": "boolean type matches booleans", 209263646Sbapt "schema": {"type": "boolean"}, 210263646Sbapt "tests": [ 211263646Sbapt { 212263646Sbapt "description": "an integer is not a boolean", 213263646Sbapt "data": 1, 214263646Sbapt "valid": false 215263646Sbapt }, 216263646Sbapt { 217263646Sbapt "description": "a float is not a boolean", 218263646Sbapt "data": 1.1, 219263646Sbapt "valid": false 220263646Sbapt }, 221263646Sbapt { 222263646Sbapt "description": "a string is not a boolean", 223263646Sbapt "data": "foo", 224263646Sbapt "valid": false 225263646Sbapt }, 226263646Sbapt { 227263646Sbapt "description": "an object is not a boolean", 228263646Sbapt "data": {}, 229263646Sbapt "valid": false 230263646Sbapt }, 231263646Sbapt { 232263646Sbapt "description": "an array is not a boolean", 233263646Sbapt "data": [], 234263646Sbapt "valid": false 235263646Sbapt }, 236263646Sbapt { 237263646Sbapt "description": "a boolean is not a boolean", 238263646Sbapt "data": true, 239263646Sbapt "valid": true 240263646Sbapt }, 241263646Sbapt { 242263646Sbapt "description": "null is not a boolean", 243263646Sbapt "data": null, 244263646Sbapt "valid": false 245263646Sbapt } 246263646Sbapt ] 247263646Sbapt }, 248263646Sbapt { 249263646Sbapt "description": "null type matches only the null object", 250263646Sbapt "schema": {"type": "null"}, 251263646Sbapt "tests": [ 252263646Sbapt { 253263646Sbapt "description": "an integer is not null", 254263646Sbapt "data": 1, 255263646Sbapt "valid": false 256263646Sbapt }, 257263646Sbapt { 258263646Sbapt "description": "a float is not null", 259263646Sbapt "data": 1.1, 260263646Sbapt "valid": false 261263646Sbapt }, 262263646Sbapt { 263263646Sbapt "description": "a string is not null", 264263646Sbapt "data": "foo", 265263646Sbapt "valid": false 266263646Sbapt }, 267263646Sbapt { 268263646Sbapt "description": "an object is not null", 269263646Sbapt "data": {}, 270263646Sbapt "valid": false 271263646Sbapt }, 272263646Sbapt { 273263646Sbapt "description": "an array is not null", 274263646Sbapt "data": [], 275263646Sbapt "valid": false 276263646Sbapt }, 277263646Sbapt { 278263646Sbapt "description": "a boolean is not null", 279263646Sbapt "data": true, 280263646Sbapt "valid": false 281263646Sbapt }, 282263646Sbapt { 283263646Sbapt "description": "null is null", 284263646Sbapt "data": null, 285263646Sbapt "valid": true 286263646Sbapt } 287263646Sbapt ] 288263646Sbapt }, 289263646Sbapt { 290263646Sbapt "description": "multiple types can be specified in an array", 291263646Sbapt "schema": {"type": ["integer", "string"]}, 292263646Sbapt "tests": [ 293263646Sbapt { 294263646Sbapt "description": "an integer is valid", 295263646Sbapt "data": 1, 296263646Sbapt "valid": true 297263646Sbapt }, 298263646Sbapt { 299263646Sbapt "description": "a string is valid", 300263646Sbapt "data": "foo", 301263646Sbapt "valid": true 302263646Sbapt }, 303263646Sbapt { 304263646Sbapt "description": "a float is invalid", 305263646Sbapt "data": 1.1, 306263646Sbapt "valid": false 307263646Sbapt }, 308263646Sbapt { 309263646Sbapt "description": "an object is invalid", 310263646Sbapt "data": {}, 311263646Sbapt "valid": false 312263646Sbapt }, 313263646Sbapt { 314263646Sbapt "description": "an array is invalid", 315263646Sbapt "data": [], 316263646Sbapt "valid": false 317263646Sbapt }, 318263646Sbapt { 319263646Sbapt "description": "a boolean is invalid", 320263646Sbapt "data": true, 321263646Sbapt "valid": false 322263646Sbapt }, 323263646Sbapt { 324263646Sbapt "description": "null is invalid", 325263646Sbapt "data": null, 326263646Sbapt "valid": false 327263646Sbapt } 328263646Sbapt ] 329263646Sbapt } 330263646Sbapt] 331