Skip to content

Commit 1b2312a

Browse files
committed
Validation: Allow numeric forms for exclusiveMinimum/exclusiveMaximum
1 parent 4650004 commit 1b2312a

File tree

1 file changed

+17
-19
lines changed

1 file changed

+17
-19
lines changed

jsonschema-validation.xml

+17-19
Original file line numberDiff line numberDiff line change
@@ -216,49 +216,47 @@
216216
The value of "multipleOf" MUST be a number, strictly greater than 0.
217217
</t>
218218
<t>
219-
A numeric instance is only valid if division by this keyword's value results in an integer.
219+
A numeric instance is valid only if division by this keyword's value results in an integer.
220220
</t>
221221
</section>
222222

223223
<section title="maximum">
224-
<t>
225-
The value of "maximum" MUST be a number, representing an upper limit for a numeric instance.
226-
</t>
227-
<t>
228-
If the instance is a number, then this keyword validates if "exclusiveMaximum" is true and instance is less than the provided value,
229-
or else if the instance is less than or exactly equal to the provided value.
230-
</t>
224+
<t>
225+
The value of "maximum" MUST be a number, representing an inclusive upper limit for a numeric instance.
226+
</t>
227+
<t>
228+
If "exclusiveMaximum" is true, see the validation rules for that keyword instead.
229+
Else if the instance is a number, then this keyword validates only if the instance is less than or exactly equal to "maximum".
230+
</t>
231231
</section>
232232

233233
<section title="exclusiveMaximum">
234234
<t>
235-
The value of "exclusiveMaximum" MUST be a boolean, representing whether the limit in "maximum" is exclusive or not.
236-
An undefined value is the same as false.
235+
The value of "exclusiveMaximum" MUST be number, representing an exclusive upper limit for a numeric instance, or a boolean. Schemas SHOULD NOT use the boolean form.
237236
</t>
238237
<t>
239-
If "exclusiveMaximum" is true, then a numeric instance SHOULD NOT be equal to the value specified in "maximum".
240-
If "exclusiveMaximum" is false (or not specified), then a numeric instance MAY be equal to the value of "maximum".
238+
If "exclusiveMaximum" is true, "maximum" is a number, and the instance is a number, then the instance is valid only if it has a value strictly less than (not equal to) "maximum".
239+
Else if "exclusiveMaximum" is a number and the instance is a number, then the instance is valid only if it has a value strictly less than (not equal to) "exclusiveMaximum".
241240
</t>
242241
</section>
243242

244243
<section title="minimum">
245244
<t>
246-
The value of "minimum" MUST be a number, representing a lower limit for a numeric instance.
245+
The value of "minimum" MUST be a number, representing an inclusive upper limit for a numeric instance.
247246
</t>
248247
<t>
249-
If the instance is a number, then this keyword validates if "exclusiveMinimum" is true and instance is greater than the provided value,
250-
or else if the instance is greater than or exactly equal to the provided value.
248+
If "exclusiveMinimum" is true, see the validation rules for that keyword instead.
249+
Else if the instance is a number, then this keyword validates only if the instance is greater than or exactly equal to "minimum".
251250
</t>
252251
</section>
253252

254253
<section title="exclusiveMinimum">
255254
<t>
256-
The value of "exclusiveMinimum" MUST be a boolean, representing whether the limit in "minimum" is exclusive or not.
257-
An undefined value is the same as false.
255+
The value of "exclusiveMinimum" MUST be number, representing an exclusive upper limit for a numeric instance, or a boolean. Schemas SHOULD NOT use the boolean form.
258256
</t>
259257
<t>
260-
If "exclusiveMinimum" is true, then a numeric instance SHOULD NOT be equal to the value specified in "minimum".
261-
If "exclusiveMinimum" is false (or not specified), then a numeric instance MAY be equal to the value of "minimum".
258+
If "exclusiveMinimum" is true, "minimum" is a number, and the instance is a number, then the instance is valid only if it has a value strictly greater than (not equal to) "minimum".
259+
Else if "exclusiveMinimum" is a number and the instance is a number, then the instance is valid only if it has a value strictly greater than (not equal to) "exclusiveMinimum".
262260
</t>
263261
</section>
264262

0 commit comments

Comments
 (0)