Skip to content
This repository was archived by the owner on Nov 3, 2023. It is now read-only.

Commit ab7c1e4

Browse files
dud225mdboom
authored andcommitted
Update exclusive* keywords specification
exclusiveMinimum and exclusiveMaximum are no longer boolean values changing the behaviour of respectively the minimum and maximum keywords, but are now fully independent keywords incompatible with minimum and maximum.
1 parent 99f4add commit ab7c1e4

File tree

1 file changed

+28
-20
lines changed

1 file changed

+28
-20
lines changed

source/reference/numeric.rst

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -149,45 +149,53 @@ Range
149149
'''''
150150

151151
Ranges of numbers are specified using a combination of the
152-
``minimum``, ``maximum``, ``exclusiveMinimum`` and
153-
``exclusiveMaximum`` keywords.
152+
``minimum`` and ``maximum`` keywords (or ``exclusiveMinimum`` and
153+
``exclusiveMaximum`` for expressing exclusive range).
154154

155-
- ``minimum`` specifies a minimum numeric value.
155+
- ``minimum`` specifies an inclusive lower limit for a numeric instance,
156+
i.e., :math:`x \ge\mathrm{min}`.
157+
158+
- ``exclusiveMinimum`` specifies an exclusive lower limit for a numeric instance,
159+
i.e., :math:`x > \mathrm{min}`.
156160

157-
- ``exclusiveMinimum`` is a boolean. When ``true``, it indicates that
158-
the range excludes the minimum value, i.e., :math:`x >
159-
\mathrm{min}`. When ``false`` (or not included), it indicates that
160-
the range includes the minimum value, i.e., :math:`x \ge
161-
\mathrm{min}`.
162-
163-
- ``maximum`` specifies a maximum numeric value.
164-
165-
- ``exclusiveMaximum`` is a boolean. When ``true``, it indicates that
166-
the range excludes the maximum value, i.e., :math:`x <
167-
\mathrm{max}`. When ``false`` (or not included), it indicates that
168-
the range includes the maximum value, i.e., :math:`x \le
169-
\mathrm{max}`.
161+
- ``maximum`` specifies an inclusive upper limit for a numeric instance,
162+
i.e., :math:`x \le\mathrm{max}`.
163+
164+
- ``exclusiveMaximum`` specifies an exclusive upper limit for a numeric
165+
instance. , i.e., :math:`x < \mathrm{max}`.
170166

171167
.. schema_example::
172168

173169
{
174170
"type": "number",
175171
"minimum": 0,
176-
"maximum": 100,
177-
"exclusiveMaximum": true
172+
"maximum": 100
178173
}
179174
--X
180175
// Less than ``minimum``:
181176
-1
182177
--
183-
// ``exclusiveMinimum`` was not specified, so 0 is included:
178+
// ``minimum`` is inclusive, so 0 is valid:
184179
0
185180
--
186181
10
187182
--
188183
99
189184
--X
190-
// ``exclusiveMaximum`` is ``true``, so 100 is not included:
185+
// ``maximum`` is inclusive, so 100 is valid:
186+
100
187+
--X
188+
// Greater than ``maximum``:
189+
101
190+
191+
.. schema_example::
192+
{
193+
"type": "number",
194+
"minimum": 0,
195+
"exclusiveMaximum": 100
196+
}
197+
--X
198+
// ``exclusiveMaximum`` is exclusive, so 100 is not valid:
191199
100
192200
--X
193201
// Greater than ``maximum``:

0 commit comments

Comments
 (0)