Debian Codegraph @

share/tests/draft6/maxProperties.json

raw
1 [
2 {
3 "description": "maxProperties validation",
4 "schema": {"maxProperties": 2},
5 "tests": [
6 {
7 "description": "shorter is valid",
8 "data": {"foo": 1},
9 "valid": true
10 },
11 {
12 "description": "exact length is valid",
13 "data": {"foo": 1, "bar": 2},
14 "valid": true
15 },
16 {
17 "description": "too long is invalid",
18 "data": {"foo": 1, "bar": 2, "baz": 3},
19 "valid": false
20 },
21 {
22 "description": "ignores arrays",
23 "data": [1, 2, 3],
24 "valid": true
25 },
26 {
27 "description": "ignores strings",
28 "data": "foobar",
29 "valid": true
30 },
31 {
32 "description": "ignores other non-objects",
33 "data": 12,
34 "valid": true
35 }
36 ]
37 },
38 {
39 "description": "maxProperties validation with a decimal",
40 "schema": {"maxProperties": 2.0},
41 "tests": [
42 {
43 "description": "shorter is valid",
44 "data": {"foo": 1},
45 "valid": true
46 },
47 {
48 "description": "too long is invalid",
49 "data": {"foo": 1, "bar": 2, "baz": 3},
50 "valid": false
51 }
52 ]
53 },
54 {
55 "description": "maxProperties = 0 means the object is empty",
56 "schema": { "maxProperties": 0 },
57 "tests": [
58 {
59 "description": "no properties is valid",
60 "data": {},
61 "valid": true
62 },
63 {
64 "description": "one property is invalid",
65 "data": { "foo": 1 },
66 "valid": false
67 }
68 ]
69 }
70 ]