summaryrefslogtreecommitdiff
path: root/json/tests/draft6/uniqueItems.json
blob: c1f4ab99c9a485d4d8a9d9f97b4945899cbcd4b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
[
    {
        "description": "uniqueItems validation",
        "schema": {"uniqueItems": true},
        "tests": [
            {
                "description": "unique array of integers is valid",
                "data": [1, 2],
                "valid": true
            },
            {
                "description": "non-unique array of integers is invalid",
                "data": [1, 1],
                "valid": false
            },
            {
                "description": "numbers are unique if mathematically unequal",
                "data": [1.0, 1.00, 1],
                "valid": false
            },
            {
                "description": "unique array of objects is valid",
                "data": [{"foo": "bar"}, {"foo": "baz"}],
                "valid": true
            },
            {
                "description": "non-unique array of objects is invalid",
                "data": [{"foo": "bar"}, {"foo": "bar"}],
                "valid": false
            },
            {
                "description": "unique array of nested objects is valid",
                "data": [
                    {"foo": {"bar" : {"baz" : true}}},
                    {"foo": {"bar" : {"baz" : false}}}
                ],
                "valid": true
            },
            {
                "description": "non-unique array of nested objects is invalid",
                "data": [
                    {"foo": {"bar" : {"baz" : true}}},
                    {"foo": {"bar" : {"baz" : true}}}
                ],
                "valid": false
            },
            {
                "description": "unique array of arrays is valid",
                "data": [["foo"], ["bar"]],
                "valid": true
            },
            {
                "description": "non-unique array of arrays is invalid",
                "data": [["foo"], ["foo"]],
                "valid": false
            },
            {
                "description": "1 and true are unique",
                "data": [1, true],
                "valid": true
            },
            {
                "description": "0 and false are unique",
                "data": [0, false],
                "valid": true
            },
            {
                "description": "unique heterogeneous types are valid",
                "data": [{}, [1], true, null, 1],
                "valid": true
            },
            {
                "description": "non-unique heterogeneous types are invalid",
                "data": [{}, [1], true, null, {}, 1],
                "valid": false
            }
        ]
    }
]