summaryrefslogtreecommitdiff
path: root/json/tests/draft6/unknownKeyword.json
blob: 1f58d97e3e664992fb5602fb76729f111db61507 (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
[
    {
        "description": "$id inside an unknown keyword is not a real identifier",
        "comment": "the implementation must not be confused by an $id in locations we do not know how to parse",
        "schema": {
            "definitions": {
                "id_in_unknown0": {
                    "not": {
                        "array_of_schemas": [
                            {
                              "$id": "https://localhost:1234/unknownKeyword/my_identifier.json",
                              "type": "null"
                            }
                        ]
                    }
                },
                "real_id_in_schema": {
                    "$id": "https://localhost:1234/unknownKeyword/my_identifier.json",
                    "type": "string"
                },
                "id_in_unknown1": {
                    "not": {
                        "object_of_schemas": {
                            "foo": {
                              "$id": "https://localhost:1234/unknownKeyword/my_identifier.json",
                              "type": "integer"
                            }
                        }
                    }
                }
            },
            "anyOf": [
                { "$ref": "#/definitions/id_in_unknown0" },
                { "$ref": "#/definitions/id_in_unknown1" },
                { "$ref": "https://localhost:1234/unknownKeyword/my_identifier.json" }
            ]
        },
        "tests": [
            {
                "description": "type matches second anyOf, which has a real schema in it",
                "data": "a string",
                "valid": true
            },
            {
                "description": "type matches non-schema in first anyOf",
                "data": null,
                "valid": false
            },
            {
                "description": "type matches non-schema in third anyOf",
                "data": 1,
                "valid": false
            }
        ]
    }
]