summaryrefslogtreecommitdiff
path: root/tests/draft2019-09/unknownKeyword.json
blob: f98e87c54003f7979c834b37e3b339fb6e838e8c (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
[
    {
        "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": {
            "$schema": "https://json-schema.org/draft/2019-09/schema",
            "$defs": {
                "id_in_unknown0": {
                    "not": {
                        "array_of_schemas": [
                            {
                              "$id": "https://localhost:1234/draft2019-09/unknownKeyword/my_identifier.json",
                              "type": "null"
                            }
                        ]
                    }
                },
                "real_id_in_schema": {
                    "$id": "https://localhost:1234/draft2019-09/unknownKeyword/my_identifier.json",
                    "type": "string"
                },
                "id_in_unknown1": {
                    "not": {
                        "object_of_schemas": {
                            "foo": {
                              "$id": "https://localhost:1234/draft2019-09/unknownKeyword/my_identifier.json",
                              "type": "integer"
                            }
                        }
                    }
                }
            },
            "anyOf": [
                { "$ref": "#/$defs/id_in_unknown0" },
                { "$ref": "#/$defs/id_in_unknown1" },
                { "$ref": "https://localhost:1234/draft2019-09/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
            }
        ]
    }
]