xref: /aosp_15_r20/external/json-schema-validator/src/test/suite/tests/draft4/maximum.json (revision 78c4dd6aa35290980cdcd1623a7e337e8d021c7c)
1[
2    {
3        "description": "maximum validation",
4        "schema": {"maximum": 3.0},
5        "tests": [
6            {
7                "description": "below the maximum is valid",
8                "data": 2.6,
9                "valid": true
10            },
11            {
12                "description": "boundary point is valid",
13                "data": 3.0,
14                "valid": true
15            },
16            {
17                "description": "above the maximum is invalid",
18                "data": 3.5,
19                "valid": false
20            },
21            {
22                "description": "ignores non-numbers",
23                "data": "x",
24                "valid": true
25            }
26        ]
27    },
28    {
29        "description": "maximum validation with unsigned integer",
30        "schema": {"maximum": 300},
31        "tests":  [
32            {
33                "description": "below the maximum is invalid",
34                "data": 299.97,
35                "valid": true
36            },
37            {
38                "description": "boundary point integer is valid",
39                "data": 300,
40                "valid": true
41            },
42            {
43                "description": "boundary point float is valid",
44                "data": 300.00,
45                "valid": true
46            },
47            {
48                "description": "above the maximum is invalid",
49                "data": 300.5,
50                "valid": false
51            }
52        ]
53    },
54    {
55        "description": "maximum validation (explicit false exclusivity)",
56        "schema": {"maximum": 3.0, "exclusiveMaximum": false},
57        "tests": [
58            {
59                "description": "below the maximum is valid",
60                "data": 2.6,
61                "valid": true
62            },
63            {
64                "description": "boundary point is valid",
65                "data": 3.0,
66                "valid": true
67            },
68            {
69                "description": "above the maximum is invalid",
70                "data": 3.5,
71                "valid": false
72            },
73            {
74                "description": "ignores non-numbers",
75                "data": "x",
76                "valid": true
77            }
78        ]
79    },
80    {
81        "description": "exclusiveMaximum validation",
82        "schema": {
83            "maximum": 3.0,
84            "exclusiveMaximum": true
85        },
86        "tests": [
87            {
88                "description": "below the maximum is still valid",
89                "data": 2.2,
90                "valid": true
91            },
92            {
93                "description": "boundary point is invalid",
94                "data": 3.0,
95                "valid": false
96            }
97        ]
98    }
99]
100