summaryrefslogtreecommitdiff
path: root/json/tests/draft2020-12/optional/format/regex.json
blob: a036c6de87d3c5f60d04929c230a99ee4022072b (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
[
    {
        "description": "validation of regular expressions",
        "schema": {
            "$schema": "https://json-schema.org/draft/2020-12/schema",
            "format": "regex"
        },
        "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 regular expression",
                "data": "([abc])+\\s+$",
                "valid": true
            },
            {
                "description": "a regular expression with unclosed parens is invalid",
                "data": "^(abc]",
                "valid": false
            }
        ]
    }
]