summaryrefslogtreecommitdiff
path: root/tests/draft7/optional/format/relative-json-pointer.json
blob: 9309986fb22af77141902b464040eaec7adc13d1 (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
80
81
82
83
[
    {
        "description": "validation of Relative JSON Pointers (RJP)",
        "schema": { "format": "relative-json-pointer" },
        "tests": [
            {
                "description": "all string formats ignore integers",
                "data": 12,
                "valid": true
            },
            {
                "description": "all string formats ignore floats",
                "data": 13.7,
                "valid": true
            },
            {
                "description": "all string formats ignore objects",
                "data": {},
                "valid": true
            },
            {
                "description": "all string formats ignore arrays",
                "data": [],
                "valid": true
            },
            {
                "description": "all string formats ignore booleans",
                "data": false,
                "valid": true
            },
            {
                "description": "all string formats ignore nulls",
                "data": null,
                "valid": true
            },
            {
                "description": "a valid upwards RJP",
                "data": "1",
                "valid": true
            },
            {
                "description": "a valid downwards RJP",
                "data": "0/foo/bar",
                "valid": true
            },
            {
                "description": "a valid up and then down RJP, with array index",
                "data": "2/0/baz/1/zip",
                "valid": true
            },
            {
                "description": "a valid RJP taking the member or index name",
                "data": "0#",
                "valid": true
            },
            {
                "description": "an invalid RJP that is a valid JSON Pointer",
                "data": "/foo/bar",
                "valid": false
            },
            {
                "description": "negative prefix",
                "data": "-1/foo/bar",
                "valid": false
            },
            {
                "description": "## is not a valid json-pointer",
                "data": "0##",
                "valid": false
            },
            {
                "description": "zero cannot be followed by other digits, plus json-pointer",
                "data": "01/a",
                "valid": false
            },
            {
                "description": "zero cannot be followed by other digits, plus octothorpe",
                "data": "01#",
                "valid": false
            }
        ]
    }
]