summaryrefslogtreecommitdiff
path: root/tests/draft-next/infinite-loop-detection.json
blob: fa66743bcd2e2a08383b4b8a31b8ef1ac9141281 (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
[
    {
        "description": "evaluating the same schema location against the same data location twice is not a sign of an infinite loop",
        "schema": {
            "$schema": "https://json-schema.org/draft/next/schema",
            "$defs": {
                "int": { "type": "integer" }
            },
            "allOf": [
                {
                    "properties": {
                        "foo": {
                            "$ref": "#/$defs/int"
                        }
                    }
                },
                {
                    "additionalProperties": {
                        "$ref": "#/$defs/int"
                    }
                }
            ]
        },
        "tests": [
            {
                "description": "passing case",
                "data": { "foo": 1 },
                "valid": true
            },
            {
                "description": "failing case",
                "data": { "foo": "a string" },
                "valid": false
            }
        ]
    }
]