diff --git a/jsonschema-validation.xml b/jsonschema-validation.xml index c979e8c0..7d92335f 100644 --- a/jsonschema-validation.xml +++ b/jsonschema-validation.xml @@ -257,6 +257,9 @@ <t> 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. </t> + <t> + If "exclusiveMaximum" is a boolean, then "maximum" MUST be present, and "exclusiveMinimum" (if present) MUST also be a boolean. + </t> <t> <cref>The boolean form of "exclusiveMaximum" is expected to be removed in the future.</cref> </t> @@ -280,6 +283,9 @@ <t> 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. </t> + <t> + If "exclusiveMinimum" is a boolean, then "minimum" MUST be present, and "exclusiveMaximum" (if present) MUST also be a boolean. + </t> <t> <cref>The boolean form of "exclusiveMinimum" is expected to be removed in the future.</cref> </t> diff --git a/schema.json b/schema.json index 15502e9b..a08e21a4 100644 --- a/schema.json +++ b/schema.json @@ -54,23 +54,38 @@ "default": {}, "multipleOf": { "type": "number", - "minimum": 0, - "exclusiveMinimum": true + "exclusiveMinimum": 0 }, "maximum": { "type": "number" }, - "exclusiveMaximum": { - "type": "boolean", - "default": false - }, "minimum": { "type": "number" }, - "exclusiveMinimum": { - "type": "boolean", - "default": false - }, + "oneOf": [ + { + "exclusiveMaximum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + } + }, + { + "exclusiveMaximum": { + "type": "boolean", + "default": false + }, + "exclusiveMinimum": { + "type": "boolean", + "default": false + }, + "dependencies": { + "exclusiveMaximum": [ "maximum" ], + "exclusiveMinimum": [ "minimum" ] + } + } + ], "maxLength": { "$ref": "#/definitions/positiveInteger" }, "minLength": { "$ref": "#/definitions/positiveIntegerDefault0" }, "pattern": { @@ -144,9 +159,5 @@ "oneOf": { "$ref": "#/definitions/schemaArray" }, "not": { "$ref": "#" } }, - "dependencies": { - "exclusiveMaximum": [ "maximum" ], - "exclusiveMinimum": [ "minimum" ] - }, "default": {} }