xref: /aosp_15_r20/external/json-schema-validator/src/test/suite/tests/draft3/minimum.json (revision 78c4dd6aa35290980cdcd1623a7e337e8d021c7c)
1[
2    {
3        "description": "minimum validation",
4        "schema": {"minimum": 1.1},
5        "tests": [
6            {
7                "description": "above the minimum is valid",
8                "data": 2.6,
9                "valid": true
10            },
11            {
12                "description": "boundary point is valid",
13                "data": 1.1,
14                "valid": true
15            },
16            {
17                "description": "below the minimum is invalid",
18                "data": 0.6,
19                "valid": false
20            },
21            {
22                "description": "ignores non-numbers",
23                "data": "x",
24                "valid": true
25            }
26        ]
27    },
28    {
29        "description": "exclusiveMinimum validation",
30        "schema": {
31            "minimum": 1.1,
32            "exclusiveMinimum": true
33        },
34        "tests": [
35            {
36                "description": "above the minimum is still valid",
37                "data": 1.2,
38                "valid": true
39            },
40            {
41                "description": "boundary point is invalid",
42                "data": 1.1,
43                "valid": false
44            }
45        ]
46    },
47    {
48        "description": "minimum validation with signed integer",
49        "schema": {"minimum": -2},
50        "tests": [
51            {
52                "description": "negative above the minimum is valid",
53                "data": -1,
54                "valid": true
55            },
56            {
57                "description": "positive above the minimum is valid",
58                "data": 0,
59                "valid": true
60            },
61            {
62                "description": "boundary point is valid",
63                "data": -2,
64                "valid": true
65            },
66            {
67                "description": "boundary point with float is valid",
68                "data": -2.0,
69                "valid": true
70            },
71            {
72                "description": "float below the minimum is invalid",
73                "data": -2.0001,
74                "valid": false
75            },
76            {
77                "description": "int below the minimum is invalid",
78                "data": -3,
79                "valid": false
80            },
81            {
82                "description": "ignores non-numbers",
83                "data": "x",
84                "valid": true
85            }
86        ]
87    }
88]
89