xref: /aosp_15_r20/external/json-schema-validator/src/test/suite/tests/draft4/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": "minimum validation (explicit false exclusivity)",
30        "schema": {"minimum": 1.1, "exclusiveMinimum": false},
31        "tests": [
32            {
33                "description": "above the minimum is valid",
34                "data": 2.6,
35                "valid": true
36            },
37            {
38                "description": "boundary point is valid",
39                "data": 1.1,
40                "valid": true
41            },
42            {
43                "description": "below the minimum is invalid",
44                "data": 0.6,
45                "valid": false
46            },
47            {
48                "description": "ignores non-numbers",
49                "data": "x",
50                "valid": true
51            }
52        ]
53    },
54    {
55        "description": "exclusiveMinimum validation",
56        "schema": {
57            "minimum": 1.1,
58            "exclusiveMinimum": true
59        },
60        "tests": [
61            {
62                "description": "above the minimum is still valid",
63                "data": 1.2,
64                "valid": true
65            },
66            {
67                "description": "boundary point is invalid",
68                "data": 1.1,
69                "valid": false
70            }
71        ]
72    },
73    {
74        "description": "minimum validation with signed integer",
75        "schema": {"minimum": -2},
76        "tests": [
77            {
78                "description": "negative above the minimum is valid",
79                "data": -1,
80                "valid": true
81            },
82            {
83                "description": "positive above the minimum is valid",
84                "data": 0,
85                "valid": true
86            },
87            {
88                "description": "boundary point is valid",
89                "data": -2,
90                "valid": true
91            },
92            {
93                "description": "boundary point with float is valid",
94                "data": -2.0,
95                "valid": true
96            },
97            {
98                "description": "float below the minimum is invalid",
99                "data": -2.0001,
100                "valid": false
101            },
102            {
103                "description": "int below the minimum is invalid",
104                "data": -3,
105                "valid": false
106            },
107            {
108                "description": "ignores non-numbers",
109                "data": "x",
110                "valid": true
111            }
112        ]
113    }
114]
115