From f6960eeed6920e95606b954819e4bb11db258f7f Mon Sep 17 00:00:00 2001 From: codefromlani Date: Tue, 9 Jun 2026 18:59:19 +0100 Subject: [PATCH 1/4] Add maximum tests --- validation/tests/maximum.json | 103 ++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 validation/tests/maximum.json diff --git a/validation/tests/maximum.json b/validation/tests/maximum.json new file mode 100644 index 000000000..2d6c99693 --- /dev/null +++ b/validation/tests/maximum.json @@ -0,0 +1,103 @@ +[ + { + "description": "maximum validation", + "compatibility": "3", + "schema": {"maximum": 3.0}, + "tests": [ + { + "description": "below the maximum is valid", + "data": 2.6, + "valid": true + }, + { + "description": "boundary point is valid", + "data": 3.0, + "valid": true + }, + { + "description": "above the maximum is invalid", + "data": 3.5, + "valid": false + }, + { + "description": "ignores non-numbers", + "data": "x", + "valid": true + } + ] + }, + { + "description": "maximum validation with unsigned integer", + "compatibility": "3", + "schema": {"maximum": 300}, + "tests": [ + { + "description": "below the maximum is valid", + "data": 299.97, + "valid": true + }, + { + "description": "boundary point integer is valid", + "data": 300, + "valid": true + }, + { + "description": "boundary point float is valid", + "data": 300.00, + "valid": true + }, + { + "description": "above the maximum is invalid", + "data": 300.5, + "valid": false + } + ] + }, + { + "description": "maximum validation (explicit false exclusivity)", + "compatibility": "=4", + "schema": {"maximum": 3.0, "exclusiveMaximum": false}, + "tests": [ + { + "description": "below the maximum is valid", + "data": 2.6, + "valid": true + }, + { + "description": "boundary point is valid", + "data": 3.0, + "valid": true + }, + { + "description": "above the maximum is invalid", + "data": 3.5, + "valid": false + }, + { + "description": "ignores non-numbers", + "data": "x", + "valid": true + } + ] + }, + { + "description": "exclusiveMaximum validation", + "compatibility": "=4", + "schema": { + "maximum": 3.0, + "exclusiveMaximum": true + }, + "tests": [ + { + "description": "below the maximum is still valid", + "data": 2.2, + "valid": true + }, + { + "description": "boundary point is invalid", + "data": 3.0, + "valid": false + } + ] + } +] \ No newline at end of file From 2fa841ba4061577d8c457d1dff0e4d260da00d13 Mon Sep 17 00:00:00 2001 From: codefromlani Date: Wed, 17 Jun 2026 19:16:38 +0100 Subject: [PATCH 2/4] Add maximum validation tests --- tests/draft2019-09/maximum.json | 60 ---------- tests/draft2020-12/maximum.json | 60 ---------- tests/draft3/maximum.json | 99 ---------------- tests/draft4/maximum.json | 99 ---------------- tests/draft6/maximum.json | 54 --------- tests/draft7/maximum.json | 54 --------- validation/tests/maximum.json | 204 ++++++++++++++++---------------- 7 files changed, 103 insertions(+), 527 deletions(-) delete mode 100644 tests/draft2019-09/maximum.json delete mode 100644 tests/draft2020-12/maximum.json delete mode 100644 tests/draft3/maximum.json delete mode 100644 tests/draft4/maximum.json delete mode 100644 tests/draft6/maximum.json delete mode 100644 tests/draft7/maximum.json diff --git a/tests/draft2019-09/maximum.json b/tests/draft2019-09/maximum.json deleted file mode 100644 index 6b38d203b..000000000 --- a/tests/draft2019-09/maximum.json +++ /dev/null @@ -1,60 +0,0 @@ -[ - { - "description": "maximum validation", - "schema": { - "$schema": "https://json-schema.org/draft/2019-09/schema", - "maximum": 3.0 - }, - "tests": [ - { - "description": "below the maximum is valid", - "data": 2.6, - "valid": true - }, - { - "description": "boundary point is valid", - "data": 3.0, - "valid": true - }, - { - "description": "above the maximum is invalid", - "data": 3.5, - "valid": false - }, - { - "description": "ignores non-numbers", - "data": "x", - "valid": true - } - ] - }, - { - "description": "maximum validation with unsigned integer", - "schema": { - "$schema": "https://json-schema.org/draft/2019-09/schema", - "maximum": 300 - }, - "tests": [ - { - "description": "below the maximum is valid", - "data": 299.97, - "valid": true - }, - { - "description": "boundary point integer is valid", - "data": 300, - "valid": true - }, - { - "description": "boundary point float is valid", - "data": 300.00, - "valid": true - }, - { - "description": "above the maximum is invalid", - "data": 300.5, - "valid": false - } - ] - } -] diff --git a/tests/draft2020-12/maximum.json b/tests/draft2020-12/maximum.json deleted file mode 100644 index 7eeab2877..000000000 --- a/tests/draft2020-12/maximum.json +++ /dev/null @@ -1,60 +0,0 @@ -[ - { - "description": "maximum validation", - "schema": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "maximum": 3.0 - }, - "tests": [ - { - "description": "below the maximum is valid", - "data": 2.6, - "valid": true - }, - { - "description": "boundary point is valid", - "data": 3.0, - "valid": true - }, - { - "description": "above the maximum is invalid", - "data": 3.5, - "valid": false - }, - { - "description": "ignores non-numbers", - "data": "x", - "valid": true - } - ] - }, - { - "description": "maximum validation with unsigned integer", - "schema": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "maximum": 300 - }, - "tests": [ - { - "description": "below the maximum is valid", - "data": 299.97, - "valid": true - }, - { - "description": "boundary point integer is valid", - "data": 300, - "valid": true - }, - { - "description": "boundary point float is valid", - "data": 300.00, - "valid": true - }, - { - "description": "above the maximum is invalid", - "data": 300.5, - "valid": false - } - ] - } -] diff --git a/tests/draft3/maximum.json b/tests/draft3/maximum.json deleted file mode 100644 index bd3e90754..000000000 --- a/tests/draft3/maximum.json +++ /dev/null @@ -1,99 +0,0 @@ -[ - { - "description": "maximum validation", - "schema": {"maximum": 3.0}, - "tests": [ - { - "description": "below the maximum is valid", - "data": 2.6, - "valid": true - }, - { - "description": "boundary point is valid", - "data": 3.0, - "valid": true - }, - { - "description": "above the maximum is invalid", - "data": 3.5, - "valid": false - }, - { - "description": "ignores non-numbers", - "data": "x", - "valid": true - } - ] - }, - { - "description": "maximum validation with unsigned integer", - "schema": {"maximum": 300}, - "tests": [ - { - "description": "below the maximum is valid", - "data": 299.97, - "valid": true - }, - { - "description": "boundary point integer is valid", - "data": 300, - "valid": true - }, - { - "description": "boundary point float is valid", - "data": 300.00, - "valid": true - }, - { - "description": "above the maximum is invalid", - "data": 300.5, - "valid": false - } - ] - }, - { - "description": "maximum validation (explicit false exclusivity)", - "schema": {"maximum": 3.0, "exclusiveMaximum": false}, - "tests": [ - { - "description": "below the maximum is valid", - "data": 2.6, - "valid": true - }, - { - "description": "boundary point is valid", - "data": 3.0, - "valid": true - }, - { - "description": "above the maximum is invalid", - "data": 3.5, - "valid": false - }, - { - "description": "ignores non-numbers", - "data": "x", - "valid": true - } - ] - }, - { - "description": "exclusiveMaximum validation", - "schema": { - "maximum": 3.0, - "exclusiveMaximum": true - }, - "tests": [ - { - "description": "below the maximum is still valid", - "data": 2.2, - "valid": true - }, - { - "description": "boundary point is invalid", - "data": 3.0, - "valid": false - } - ] - } -] diff --git a/tests/draft4/maximum.json b/tests/draft4/maximum.json deleted file mode 100644 index bd3e90754..000000000 --- a/tests/draft4/maximum.json +++ /dev/null @@ -1,99 +0,0 @@ -[ - { - "description": "maximum validation", - "schema": {"maximum": 3.0}, - "tests": [ - { - "description": "below the maximum is valid", - "data": 2.6, - "valid": true - }, - { - "description": "boundary point is valid", - "data": 3.0, - "valid": true - }, - { - "description": "above the maximum is invalid", - "data": 3.5, - "valid": false - }, - { - "description": "ignores non-numbers", - "data": "x", - "valid": true - } - ] - }, - { - "description": "maximum validation with unsigned integer", - "schema": {"maximum": 300}, - "tests": [ - { - "description": "below the maximum is valid", - "data": 299.97, - "valid": true - }, - { - "description": "boundary point integer is valid", - "data": 300, - "valid": true - }, - { - "description": "boundary point float is valid", - "data": 300.00, - "valid": true - }, - { - "description": "above the maximum is invalid", - "data": 300.5, - "valid": false - } - ] - }, - { - "description": "maximum validation (explicit false exclusivity)", - "schema": {"maximum": 3.0, "exclusiveMaximum": false}, - "tests": [ - { - "description": "below the maximum is valid", - "data": 2.6, - "valid": true - }, - { - "description": "boundary point is valid", - "data": 3.0, - "valid": true - }, - { - "description": "above the maximum is invalid", - "data": 3.5, - "valid": false - }, - { - "description": "ignores non-numbers", - "data": "x", - "valid": true - } - ] - }, - { - "description": "exclusiveMaximum validation", - "schema": { - "maximum": 3.0, - "exclusiveMaximum": true - }, - "tests": [ - { - "description": "below the maximum is still valid", - "data": 2.2, - "valid": true - }, - { - "description": "boundary point is invalid", - "data": 3.0, - "valid": false - } - ] - } -] diff --git a/tests/draft6/maximum.json b/tests/draft6/maximum.json deleted file mode 100644 index c3e727069..000000000 --- a/tests/draft6/maximum.json +++ /dev/null @@ -1,54 +0,0 @@ -[ - { - "description": "maximum validation", - "schema": {"maximum": 3.0}, - "tests": [ - { - "description": "below the maximum is valid", - "data": 2.6, - "valid": true - }, - { - "description": "boundary point is valid", - "data": 3.0, - "valid": true - }, - { - "description": "above the maximum is invalid", - "data": 3.5, - "valid": false - }, - { - "description": "ignores non-numbers", - "data": "x", - "valid": true - } - ] - }, - { - "description": "maximum validation with unsigned integer", - "schema": {"maximum": 300}, - "tests": [ - { - "description": "below the maximum is valid", - "data": 299.97, - "valid": true - }, - { - "description": "boundary point integer is valid", - "data": 300, - "valid": true - }, - { - "description": "boundary point float is valid", - "data": 300.00, - "valid": true - }, - { - "description": "above the maximum is invalid", - "data": 300.5, - "valid": false - } - ] - } -] diff --git a/tests/draft7/maximum.json b/tests/draft7/maximum.json deleted file mode 100644 index c3e727069..000000000 --- a/tests/draft7/maximum.json +++ /dev/null @@ -1,54 +0,0 @@ -[ - { - "description": "maximum validation", - "schema": {"maximum": 3.0}, - "tests": [ - { - "description": "below the maximum is valid", - "data": 2.6, - "valid": true - }, - { - "description": "boundary point is valid", - "data": 3.0, - "valid": true - }, - { - "description": "above the maximum is invalid", - "data": 3.5, - "valid": false - }, - { - "description": "ignores non-numbers", - "data": "x", - "valid": true - } - ] - }, - { - "description": "maximum validation with unsigned integer", - "schema": {"maximum": 300}, - "tests": [ - { - "description": "below the maximum is valid", - "data": 299.97, - "valid": true - }, - { - "description": "boundary point integer is valid", - "data": 300, - "valid": true - }, - { - "description": "boundary point float is valid", - "data": 300.00, - "valid": true - }, - { - "description": "above the maximum is invalid", - "data": 300.5, - "valid": false - } - ] - } -] diff --git a/validation/tests/maximum.json b/validation/tests/maximum.json index 2d6c99693..b7da8d3a9 100644 --- a/validation/tests/maximum.json +++ b/validation/tests/maximum.json @@ -1,103 +1,105 @@ -[ - { - "description": "maximum validation", - "compatibility": "3", - "schema": {"maximum": 3.0}, - "tests": [ - { - "description": "below the maximum is valid", - "data": 2.6, - "valid": true - }, - { - "description": "boundary point is valid", - "data": 3.0, - "valid": true - }, - { - "description": "above the maximum is invalid", - "data": 3.5, - "valid": false - }, - { - "description": "ignores non-numbers", - "data": "x", - "valid": true - } - ] - }, - { - "description": "maximum validation with unsigned integer", - "compatibility": "3", - "schema": {"maximum": 300}, - "tests": [ - { - "description": "below the maximum is valid", - "data": 299.97, - "valid": true - }, - { - "description": "boundary point integer is valid", - "data": 300, - "valid": true - }, - { - "description": "boundary point float is valid", - "data": 300.00, - "valid": true - }, - { - "description": "above the maximum is invalid", - "data": 300.5, - "valid": false - } - ] - }, - { - "description": "maximum validation (explicit false exclusivity)", - "compatibility": "=4", - "schema": {"maximum": 3.0, "exclusiveMaximum": false}, - "tests": [ - { - "description": "below the maximum is valid", - "data": 2.6, - "valid": true - }, - { - "description": "boundary point is valid", - "data": 3.0, - "valid": true - }, - { - "description": "above the maximum is invalid", - "data": 3.5, - "valid": false - }, - { - "description": "ignores non-numbers", - "data": "x", - "valid": true - } - ] - }, - { - "description": "exclusiveMaximum validation", - "compatibility": "=4", - "schema": { - "maximum": 3.0, - "exclusiveMaximum": true +{ + "$schema": "../validation-test-schema.json", + "description": "maximumvalidation", + "tests": [ + { + "description": "maximum validation", + "schema": { "maximum": 3.0 }, + "tests": [ + { + "description": "below the maximum is valid", + "data": 2.6, + "valid": true + }, + { + "description": "boundary point is valid", + "data": 3.0, + "valid": true + }, + { + "description": "above the maximum is invalid", + "data": 3.5, + "valid": false + }, + { + "description": "ignores non-numbers", + "data": "x", + "valid": true + } + ] + }, + { + "description": "maximum validation with unsigned integer", + "schema": { "maximum": 300 }, + "tests": [ + { + "description": "below the maximum is valid", + "data": 299.97, + "valid": true + }, + { + "description": "boundary point integer is valid", + "data": 300, + "valid": true + }, + { + "description": "boundary point float is valid", + "data": 300.00, + "valid": true + }, + { + "description": "above the maximum is invalid", + "data": 300.5, + "valid": false + } + ] + }, + { + "description": "maximum validation (explicit false exclusivity)", + "compatibility": "=4", + "schema": { "maximum": 3.0, "exclusiveMaximum": false }, + "tests": [ + { + "description": "below the maximum is valid", + "data": 2.6, + "valid": true + }, + { + "description": "boundary point is valid", + "data": 3.0, + "valid": true + }, + { + "description": "above the maximum is invalid", + "data": 3.5, + "valid": false + }, + { + "description": "ignores non-numbers", + "data": "x", + "valid": true + } + ] }, - "tests": [ - { - "description": "below the maximum is still valid", - "data": 2.2, - "valid": true + { + "description": "exclusiveMaximum validation", + "compatibility": "=4", + "schema": { + "maximum": 3.0, + "exclusiveMaximum": true }, - { - "description": "boundary point is invalid", - "data": 3.0, - "valid": false - } - ] - } -] \ No newline at end of file + "tests": [ + { + "description": "below the maximum is still valid", + "data": 2.2, + "valid": true + }, + { + "description": "boundary point is invalid", + "data": 3.0, + "valid": false + } + ] + } + ] +} From e3f0e8b7745bc34713432599fbc6d40c0aed29ab Mon Sep 17 00:00:00 2001 From: codefromlani Date: Fri, 19 Jun 2026 16:50:50 +0100 Subject: [PATCH 3/4] Merge exclusiveMaximum --- tests/draft2019-09/exclusiveMaximum.json | 31 ---------------------- tests/draft2020-12/exclusiveMaximum.json | 31 ---------------------- tests/draft6/exclusiveMaximum.json | 30 --------------------- tests/draft7/exclusiveMaximum.json | 30 --------------------- validation/tests/maximum.json | 33 ++++++++++++++++++++++-- 5 files changed, 31 insertions(+), 124 deletions(-) delete mode 100644 tests/draft2019-09/exclusiveMaximum.json delete mode 100644 tests/draft2020-12/exclusiveMaximum.json delete mode 100644 tests/draft6/exclusiveMaximum.json delete mode 100644 tests/draft7/exclusiveMaximum.json diff --git a/tests/draft2019-09/exclusiveMaximum.json b/tests/draft2019-09/exclusiveMaximum.json deleted file mode 100644 index 4ec85698c..000000000 --- a/tests/draft2019-09/exclusiveMaximum.json +++ /dev/null @@ -1,31 +0,0 @@ -[ - { - "description": "exclusiveMaximum validation", - "schema": { - "$schema": "https://json-schema.org/draft/2019-09/schema", - "exclusiveMaximum": 3.0 - }, - "tests": [ - { - "description": "below the exclusiveMaximum is valid", - "data": 2.2, - "valid": true - }, - { - "description": "boundary point is invalid", - "data": 3.0, - "valid": false - }, - { - "description": "above the exclusiveMaximum is invalid", - "data": 3.5, - "valid": false - }, - { - "description": "ignores non-numbers", - "data": "x", - "valid": true - } - ] - } -] diff --git a/tests/draft2020-12/exclusiveMaximum.json b/tests/draft2020-12/exclusiveMaximum.json deleted file mode 100644 index 05db23351..000000000 --- a/tests/draft2020-12/exclusiveMaximum.json +++ /dev/null @@ -1,31 +0,0 @@ -[ - { - "description": "exclusiveMaximum validation", - "schema": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "exclusiveMaximum": 3.0 - }, - "tests": [ - { - "description": "below the exclusiveMaximum is valid", - "data": 2.2, - "valid": true - }, - { - "description": "boundary point is invalid", - "data": 3.0, - "valid": false - }, - { - "description": "above the exclusiveMaximum is invalid", - "data": 3.5, - "valid": false - }, - { - "description": "ignores non-numbers", - "data": "x", - "valid": true - } - ] - } -] diff --git a/tests/draft6/exclusiveMaximum.json b/tests/draft6/exclusiveMaximum.json deleted file mode 100644 index dc3cd709d..000000000 --- a/tests/draft6/exclusiveMaximum.json +++ /dev/null @@ -1,30 +0,0 @@ -[ - { - "description": "exclusiveMaximum validation", - "schema": { - "exclusiveMaximum": 3.0 - }, - "tests": [ - { - "description": "below the exclusiveMaximum is valid", - "data": 2.2, - "valid": true - }, - { - "description": "boundary point is invalid", - "data": 3.0, - "valid": false - }, - { - "description": "above the exclusiveMaximum is invalid", - "data": 3.5, - "valid": false - }, - { - "description": "ignores non-numbers", - "data": "x", - "valid": true - } - ] - } -] diff --git a/tests/draft7/exclusiveMaximum.json b/tests/draft7/exclusiveMaximum.json deleted file mode 100644 index dc3cd709d..000000000 --- a/tests/draft7/exclusiveMaximum.json +++ /dev/null @@ -1,30 +0,0 @@ -[ - { - "description": "exclusiveMaximum validation", - "schema": { - "exclusiveMaximum": 3.0 - }, - "tests": [ - { - "description": "below the exclusiveMaximum is valid", - "data": 2.2, - "valid": true - }, - { - "description": "boundary point is invalid", - "data": 3.0, - "valid": false - }, - { - "description": "above the exclusiveMaximum is invalid", - "data": 3.5, - "valid": false - }, - { - "description": "ignores non-numbers", - "data": "x", - "valid": true - } - ] - } -] diff --git a/validation/tests/maximum.json b/validation/tests/maximum.json index b7da8d3a9..3983a6058 100644 --- a/validation/tests/maximum.json +++ b/validation/tests/maximum.json @@ -1,6 +1,6 @@ { "$schema": "../validation-test-schema.json", - "description": "maximumvalidation", + "description": "maximum validation", "tests": [ { "description": "maximum validation", @@ -82,7 +82,7 @@ ] }, { - "description": "exclusiveMaximum validation", + "description": "exclusiveMaximum validation (boolean form)", "compatibility": "=4", "schema": { "maximum": 3.0, @@ -100,6 +100,35 @@ "valid": false } ] + }, + { + "description": "exclusiveMaximum validation", + "compatibility": "6", + "schema": { + "exclusiveMaximum": 3.0 + }, + "tests": [ + { + "description": "below the exclusiveMaximum is valid", + "data": 2.2, + "valid": true + }, + { + "description": "boundary point is invalid", + "data": 3.0, + "valid": false + }, + { + "description": "above the exclusiveMaximum is invalid", + "data": 3.5, + "valid": false + }, + { + "description": "ignores non-numbers", + "data": "x", + "valid": true + } + ] } ] } From 7a4b60beeb1781ae2037ff2518b1e38a83acda72 Mon Sep 17 00:00:00 2001 From: codefromlani Date: Fri, 19 Jun 2026 16:53:20 +0100 Subject: [PATCH 4/4] Update compatibility --- validation/tests/maximum.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/validation/tests/maximum.json b/validation/tests/maximum.json index 3983a6058..7d5310ec9 100644 --- a/validation/tests/maximum.json +++ b/validation/tests/maximum.json @@ -56,7 +56,7 @@ }, { "description": "maximum validation (explicit false exclusivity)", - "compatibility": "=4", + "compatibility": "3,<=4", "schema": { "maximum": 3.0, "exclusiveMaximum": false }, "tests": [ { @@ -83,7 +83,7 @@ }, { "description": "exclusiveMaximum validation (boolean form)", - "compatibility": "=4", + "compatibility": "3,<=4", "schema": { "maximum": 3.0, "exclusiveMaximum": true