Debian Codegraph @

spec/extras/$data/minimum.json

raw symbols SCIP
1 [
2 {
3 "description": "one property is minimum for another",
4 "schema": {
5 "properties": {
6 "smaller": {},
7 "largerOrEqual": {
8 "minimum": {"$data": "1/smaller"}
9 }
10 }
11 },
12 "tests": [
13 {
14 "description": "above the minimum is valid",
15 "data": {
16 "smaller": 3,
17 "largerOrEqual": 4
18 },
19 "valid": true
20 },
21 {
22 "description": "equal to the minimum is valid",
23 "data": {
24 "smaller": 3,
25 "largerOrEqual": 3
26 },
27 "valid": true
28 },
29 {
30 "description": "below the minimum is invalid",
31 "data": {
32 "smaller": 3,
33 "largerOrEqual": 2
34 },
35 "valid": false
36 },
37 {
38 "description": "ignores non-numbers",
39 "data": {
40 "smaller": 3,
41 "largerOrEqual": "2"
42 },
43 "valid": true
44 },
45 {
46 "description": "fails if value of minimum is not number",
47 "data": {
48 "smaller": "3",
49 "largerOrEqual": 4
50 },
51 "valid": false
52 }
53 ]
54 },
55 {
56 "description": "exclusiveMinimum is $data",
57 "schema": {
58 "properties": {
59 "number": {
60 "minimum": 3,
61 "exclusiveMinimum": {"$data": "1/exclusiveMinimum"}
62 },
63 "exclusiveMinimum": {}
64 }
65 },
66 "tests": [
67 {
68 "description": "exclusiveMinimum boolean no longer supported",
69 "data": {
70 "number": 4,
71 "exclusiveMinimum": true
72 },
73 "valid": false
74 },
75 {
76 "description": "above the minimum is valid when exclusiveMinimum is strictly smaller",
77 "data": {
78 "number": 4,
79 "exclusiveMinimum": 3.9
80 },
81 "valid": true
82 },
83 {
84 "description": "above the minimum is NOT valid when exclusiveMinimum is equal",
85 "data": {
86 "number": 4,
87 "exclusiveMinimum": 4
88 },
89 "valid": false
90 },
91 {
92 "description": "above the minimum is valid when exclusiveMinimum is undefined",
93 "data": {
94 "number": 4
95 },
96 "valid": true
97 },
98 {
99 "description": "boundary point is invalid when exclusiveMinimum is equal",
100 "data": {
101 "number": 3,
102 "exclusiveMinimum": 3
103 },
104 "valid": false
105 },
106 {
107 "description": "boundary point is valid when exclusiveMinimum is smaller",
108 "data": {
109 "number": 3,
110 "exclusiveMinimum": 2.9
111 },
112 "valid": true
113 },
114 {
115 "description": "boundary point is valid when exclusiveMinimum is undefined",
116 "data": {
117 "number": 3
118 },
119 "valid": true
120 },
121 {
122 "description": "below the minimum is invalid",
123 "data": {
124 "number": 2
125 },
126 "valid": false
127 },
128 {
129 "description": "fails if value of exclusiveMinimum is not number",
130 "data": {
131 "number": 4,
132 "exclusiveMinimum": "3"
133 },
134 "valid": false
135 }
136 ]
137 },
138 {
139 "description": "minimum and exclusiveMinimum are $data",
140 "schema": {
141 "properties": {
142 "smaller": {},
143 "largerOrEqual": {
144 "minimum": {"$data": "1/smaller"},
145 "exclusiveMinimum": {"$data": "1/exclusiveMinimum"}
146 },
147 "exclusiveMinimum": {}
148 }
149 },
150 "tests": [
151 {
152 "description": "exclusiveMinimum boolean no longer supported",
153 "data": {
154 "smaller": 3,
155 "largerOrEqual": 4,
156 "exclusiveMinimum": true
157 },
158 "valid": false
159 },
160 {
161 "description": "above the minimum is valid when exclusiveMinimum is strictly smaller",
162 "data": {
163 "smaller": 3,
164 "largerOrEqual": 4,
165 "exclusiveMinimum": 3.9
166 },
167 "valid": true
168 },
169 {
170 "description": "above the minimum is NOT valid when exclusiveMinimum is equal",
171 "data": {
172 "smaller": 3,
173 "largerOrEqual": 4,
174 "exclusiveMinimum": 4
175 },
176 "valid": false
177 },
178 {
179 "description": "above the minimum is valid when exclusiveMinimum is undefined",
180 "data": {
181 "smaller": 3,
182 "largerOrEqual": 4
183 },
184 "valid": true
185 },
186 {
187 "description": "below the minimum is invalid",
188 "data": {
189 "smaller": 3,
190 "largerOrEqual": 2,
191 "exclusiveMinimum": 1.5
192 },
193 "valid": false
194 },
195 {
196 "description": "below the minimum is invalid when exclusiveMinimum is undefined",
197 "data": {
198 "smaller": 3,
199 "largerOrEqual": 2
200 },
201 "valid": false
202 },
203 {
204 "description": "fails if value of exclusiveMinimum is not number",
205 "data": {
206 "smaller": 3,
207 "largerOrEqual": 4,
208 "exclusiveMinimum": "3"
209 },
210 "valid": false
211 },
212 {
213 "description": "boundary point is valid when exclusiveMinimum is strictly smaller",
214 "data": {
215 "smaller": 3,
216 "largerOrEqual": 3,
217 "exclusiveMinimum": 2.9
218 },
219 "valid": true
220 },
221 {
222 "description": "boundary point is invalid when exclusiveMinimum is equal",
223 "data": {
224 "smaller": 3,
225 "largerOrEqual": 3,
226 "exclusiveMinimum": 3
227 },
228 "valid": false
229 },
230 {
231 "description": "boundary point is valid when exclusiveMinimum is undefined",
232 "data": {
233 "smaller": 3,
234 "largerOrEqual": 3
235 },
236 "valid": true
237 }
238 ]
239 },
240 {
241 "description": "items in array are >= than their indeces",
242 "schema": {
243 "items": {
244 "minimum": {"$data": "0#"}
245 }
246 },
247 "tests": [
248 {
249 "description": "valid array",
250 "data": [1, 2, 2, 4, 5, 5],
251 "valid": true
252 },
253 {
254 "description": "invalid array (0.5<1)",
255 "data": [0, 0.5],
256 "valid": false
257 }
258 ]
259 }
260 ]