From 74dfd486fece30a0b21538874c1e960f62639fd6 Mon Sep 17 00:00:00 2001 From: Julian Berman Date: Tue, 16 Jan 2024 09:25:47 -0500 Subject: [PATCH] Squashed 'json/' changes from 217bf81b..544f7c3d 544f7c3d Merge pull request #712 from otto-ifak/main 9dad3ebe Add tests for enum with array of bool 589a0858 Merge pull request #706 from marksparkza/unevaluated-before-ref 64d5cab9 Merge pull request #710 from spacether/patch-1 418cdbd6 Removes idea folder e0a9e066 Updates all other tests to mention grapheme/graphemes 69136952 Update minLength.json 4a2c61e8 Test unevaluatedItems|Properties before $ref git-subtree-dir: json git-subtree-split: 544f7c3df93b69f84f587b345f2835c380e43226 --- json/tests/draft-next/enum.json | 96 +++++++++++++++++++ json/tests/draft-next/maxLength.json | 2 +- json/tests/draft-next/minLength.json | 2 +- json/tests/draft-next/unevaluatedItems.json | 31 ++++++ .../draft-next/unevaluatedProperties.json | 38 ++++++++ json/tests/draft2019-09/enum.json | 96 +++++++++++++++++++ json/tests/draft2019-09/maxLength.json | 2 +- json/tests/draft2019-09/minLength.json | 2 +- json/tests/draft2019-09/unevaluatedItems.json | 31 ++++++ .../draft2019-09/unevaluatedProperties.json | 38 ++++++++ json/tests/draft2020-12/enum.json | 96 +++++++++++++++++++ json/tests/draft2020-12/maxLength.json | 2 +- json/tests/draft2020-12/minLength.json | 2 +- json/tests/draft2020-12/unevaluatedItems.json | 31 ++++++ .../draft2020-12/unevaluatedProperties.json | 38 ++++++++ json/tests/draft3/maxLength.json | 2 +- json/tests/draft3/minLength.json | 2 +- json/tests/draft4/enum.json | 84 ++++++++++++++++ json/tests/draft4/maxLength.json | 2 +- json/tests/draft4/minLength.json | 2 +- json/tests/draft6/enum.json | 84 ++++++++++++++++ json/tests/draft6/maxLength.json | 2 +- json/tests/draft6/minLength.json | 2 +- json/tests/draft7/enum.json | 84 ++++++++++++++++ json/tests/draft7/maxLength.json | 2 +- json/tests/draft7/minLength.json | 2 +- 26 files changed, 761 insertions(+), 14 deletions(-) diff --git a/json/tests/draft-next/enum.json b/json/tests/draft-next/enum.json index 32e5af01b..e263f3901 100644 --- a/json/tests/draft-next/enum.json +++ b/json/tests/draft-next/enum.json @@ -168,6 +168,30 @@ } ] }, + { + "description": "enum with [false] does not match [0]", + "schema": { + "$schema": "https://json-schema.org/draft/next/schema", + "enum": [[false]] + }, + "tests": [ + { + "description": "[false] is valid", + "data": [false], + "valid": true + }, + { + "description": "[0] is invalid", + "data": [0], + "valid": false + }, + { + "description": "[0.0] is invalid", + "data": [0.0], + "valid": false + } + ] + }, { "description": "enum with true does not match 1", "schema": { @@ -192,6 +216,30 @@ } ] }, + { + "description": "enum with [true] does not match [1]", + "schema": { + "$schema": "https://json-schema.org/draft/next/schema", + "enum": [[true]] + }, + "tests": [ + { + "description": "[true] is valid", + "data": [true], + "valid": true + }, + { + "description": "[1] is invalid", + "data": [1], + "valid": false + }, + { + "description": "[1.0] is invalid", + "data": [1.0], + "valid": false + } + ] + }, { "description": "enum with 0 does not match false", "schema": { @@ -216,6 +264,30 @@ } ] }, + { + "description": "enum with [0] does not match [false]", + "schema": { + "$schema": "https://json-schema.org/draft/next/schema", + "enum": [[0]] + }, + "tests": [ + { + "description": "[false] is invalid", + "data": [false], + "valid": false + }, + { + "description": "[0] is valid", + "data": [0], + "valid": true + }, + { + "description": "[0.0] is valid", + "data": [0.0], + "valid": true + } + ] + }, { "description": "enum with 1 does not match true", "schema": { @@ -240,6 +312,30 @@ } ] }, + { + "description": "enum with [1] does not match [true]", + "schema": { + "$schema": "https://json-schema.org/draft/next/schema", + "enum": [[1]] + }, + "tests": [ + { + "description": "[true] is invalid", + "data": [true], + "valid": false + }, + { + "description": "[1] is valid", + "data": [1], + "valid": true + }, + { + "description": "[1.0] is valid", + "data": [1.0], + "valid": true + } + ] + }, { "description": "nul characters in strings", "schema": { diff --git a/json/tests/draft-next/maxLength.json b/json/tests/draft-next/maxLength.json index e09e44ad8..c88f604ef 100644 --- a/json/tests/draft-next/maxLength.json +++ b/json/tests/draft-next/maxLength.json @@ -27,7 +27,7 @@ "valid": true }, { - "description": "two supplementary Unicode code points is long enough", + "description": "two graphemes is long enough", "data": "\uD83D\uDCA9\uD83D\uDCA9", "valid": true } diff --git a/json/tests/draft-next/minLength.json b/json/tests/draft-next/minLength.json index 16022acb5..52c9c9a14 100644 --- a/json/tests/draft-next/minLength.json +++ b/json/tests/draft-next/minLength.json @@ -27,7 +27,7 @@ "valid": true }, { - "description": "one supplementary Unicode code point is not long enough", + "description": "one grapheme is not long enough", "data": "\uD83D\uDCA9", "valid": false } diff --git a/json/tests/draft-next/unevaluatedItems.json b/json/tests/draft-next/unevaluatedItems.json index 21e6fd67e..08f6ef128 100644 --- a/json/tests/draft-next/unevaluatedItems.json +++ b/json/tests/draft-next/unevaluatedItems.json @@ -461,6 +461,37 @@ } ] }, + { + "description": "unevaluatedItems before $ref", + "schema": { + "$schema": "https://json-schema.org/draft/next/schema", + "unevaluatedItems": false, + "prefixItems": [ + { "type": "string" } + ], + "$ref": "#/$defs/bar", + "$defs": { + "bar": { + "prefixItems": [ + true, + { "type": "string" } + ] + } + } + }, + "tests": [ + { + "description": "with no unevaluated items", + "data": ["foo", "bar"], + "valid": true + }, + { + "description": "with unevaluated items", + "data": ["foo", "bar", "baz"], + "valid": false + } + ] + }, { "description": "unevaluatedItems with $dynamicRef", "schema": { diff --git a/json/tests/draft-next/unevaluatedProperties.json b/json/tests/draft-next/unevaluatedProperties.json index 78127cd03..d0d53507f 100644 --- a/json/tests/draft-next/unevaluatedProperties.json +++ b/json/tests/draft-next/unevaluatedProperties.json @@ -715,6 +715,44 @@ } ] }, + { + "description": "unevaluatedProperties before $ref", + "schema": { + "$schema": "https://json-schema.org/draft/next/schema", + "type": "object", + "unevaluatedProperties": false, + "properties": { + "foo": { "type": "string" } + }, + "$ref": "#/$defs/bar", + "$defs": { + "bar": { + "properties": { + "bar": { "type": "string" } + } + } + } + }, + "tests": [ + { + "description": "with no unevaluated properties", + "data": { + "foo": "foo", + "bar": "bar" + }, + "valid": true + }, + { + "description": "with unevaluated properties", + "data": { + "foo": "foo", + "bar": "bar", + "baz": "baz" + }, + "valid": false + } + ] + }, { "description": "unevaluatedProperties with $dynamicRef", "schema": { diff --git a/json/tests/draft2019-09/enum.json b/json/tests/draft2019-09/enum.json index f9a44a61d..1315211ea 100644 --- a/json/tests/draft2019-09/enum.json +++ b/json/tests/draft2019-09/enum.json @@ -168,6 +168,30 @@ } ] }, + { + "description": "enum with [false] does not match [0]", + "schema": { + "$schema": "https://json-schema.org/draft/2019-09/schema", + "enum": [[false]] + }, + "tests": [ + { + "description": "[false] is valid", + "data": [false], + "valid": true + }, + { + "description": "[0] is invalid", + "data": [0], + "valid": false + }, + { + "description": "[0.0] is invalid", + "data": [0.0], + "valid": false + } + ] + }, { "description": "enum with true does not match 1", "schema": { @@ -192,6 +216,30 @@ } ] }, + { + "description": "enum with [true] does not match [1]", + "schema": { + "$schema": "https://json-schema.org/draft/2019-09/schema", + "enum": [[true]] + }, + "tests": [ + { + "description": "[true] is valid", + "data": [true], + "valid": true + }, + { + "description": "[1] is invalid", + "data": [1], + "valid": false + }, + { + "description": "[1.0] is invalid", + "data": [1.0], + "valid": false + } + ] + }, { "description": "enum with 0 does not match false", "schema": { @@ -216,6 +264,30 @@ } ] }, + { + "description": "enum with [0] does not match [false]", + "schema": { + "$schema": "https://json-schema.org/draft/2019-09/schema", + "enum": [[0]] + }, + "tests": [ + { + "description": "[false] is invalid", + "data": [false], + "valid": false + }, + { + "description": "[0] is valid", + "data": [0], + "valid": true + }, + { + "description": "[0.0] is valid", + "data": [0.0], + "valid": true + } + ] + }, { "description": "enum with 1 does not match true", "schema": { @@ -240,6 +312,30 @@ } ] }, + { + "description": "enum with [1] does not match [true]", + "schema": { + "$schema": "https://json-schema.org/draft/2019-09/schema", + "enum": [[1]] + }, + "tests": [ + { + "description": "[true] is invalid", + "data": [true], + "valid": false + }, + { + "description": "[1] is valid", + "data": [1], + "valid": true + }, + { + "description": "[1.0] is valid", + "data": [1.0], + "valid": true + } + ] + }, { "description": "nul characters in strings", "schema": { diff --git a/json/tests/draft2019-09/maxLength.json b/json/tests/draft2019-09/maxLength.json index f242c3eff..a0cc7d9b8 100644 --- a/json/tests/draft2019-09/maxLength.json +++ b/json/tests/draft2019-09/maxLength.json @@ -27,7 +27,7 @@ "valid": true }, { - "description": "two supplementary Unicode code points is long enough", + "description": "two graphemes is long enough", "data": "\uD83D\uDCA9\uD83D\uDCA9", "valid": true } diff --git a/json/tests/draft2019-09/minLength.json b/json/tests/draft2019-09/minLength.json index 19dec2cac..12782660c 100644 --- a/json/tests/draft2019-09/minLength.json +++ b/json/tests/draft2019-09/minLength.json @@ -27,7 +27,7 @@ "valid": true }, { - "description": "one supplementary Unicode code point is not long enough", + "description": "one grapheme is not long enough", "data": "\uD83D\uDCA9", "valid": false } diff --git a/json/tests/draft2019-09/unevaluatedItems.json b/json/tests/draft2019-09/unevaluatedItems.json index 57d0a9c00..8e2ee4b11 100644 --- a/json/tests/draft2019-09/unevaluatedItems.json +++ b/json/tests/draft2019-09/unevaluatedItems.json @@ -480,6 +480,37 @@ } ] }, + { + "description": "unevaluatedItems before $ref", + "schema": { + "$schema": "https://json-schema.org/draft/2019-09/schema", + "unevaluatedItems": false, + "items": [ + { "type": "string" } + ], + "$ref": "#/$defs/bar", + "$defs": { + "bar": { + "items": [ + true, + { "type": "string" } + ] + } + } + }, + "tests": [ + { + "description": "with no unevaluated items", + "data": ["foo", "bar"], + "valid": true + }, + { + "description": "with unevaluated items", + "data": ["foo", "bar", "baz"], + "valid": false + } + ] + }, { "description": "unevaluatedItems with $recursiveRef", "schema": { diff --git a/json/tests/draft2019-09/unevaluatedProperties.json b/json/tests/draft2019-09/unevaluatedProperties.json index a8d7fffe2..71c36dfa0 100644 --- a/json/tests/draft2019-09/unevaluatedProperties.json +++ b/json/tests/draft2019-09/unevaluatedProperties.json @@ -715,6 +715,44 @@ } ] }, + { + "description": "unevaluatedProperties before $ref", + "schema": { + "$schema": "https://json-schema.org/draft/2019-09/schema", + "type": "object", + "unevaluatedProperties": false, + "properties": { + "foo": { "type": "string" } + }, + "$ref": "#/$defs/bar", + "$defs": { + "bar": { + "properties": { + "bar": { "type": "string" } + } + } + } + }, + "tests": [ + { + "description": "with no unevaluated properties", + "data": { + "foo": "foo", + "bar": "bar" + }, + "valid": true + }, + { + "description": "with unevaluated properties", + "data": { + "foo": "foo", + "bar": "bar", + "baz": "baz" + }, + "valid": false + } + ] + }, { "description": "unevaluatedProperties with $recursiveRef", "schema": { diff --git a/json/tests/draft2020-12/enum.json b/json/tests/draft2020-12/enum.json index 0d780b2ac..c8f35eacf 100644 --- a/json/tests/draft2020-12/enum.json +++ b/json/tests/draft2020-12/enum.json @@ -168,6 +168,30 @@ } ] }, + { + "description": "enum with [false] does not match [0]", + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "enum": [[false]] + }, + "tests": [ + { + "description": "[false] is valid", + "data": [false], + "valid": true + }, + { + "description": "[0] is invalid", + "data": [0], + "valid": false + }, + { + "description": "[0.0] is invalid", + "data": [0.0], + "valid": false + } + ] + }, { "description": "enum with true does not match 1", "schema": { @@ -192,6 +216,30 @@ } ] }, + { + "description": "enum with [true] does not match [1]", + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "enum": [[true]] + }, + "tests": [ + { + "description": "[true] is valid", + "data": [true], + "valid": true + }, + { + "description": "[1] is invalid", + "data": [1], + "valid": false + }, + { + "description": "[1.0] is invalid", + "data": [1.0], + "valid": false + } + ] + }, { "description": "enum with 0 does not match false", "schema": { @@ -216,6 +264,30 @@ } ] }, + { + "description": "enum with [0] does not match [false]", + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "enum": [[0]] + }, + "tests": [ + { + "description": "[false] is invalid", + "data": [false], + "valid": false + }, + { + "description": "[0] is valid", + "data": [0], + "valid": true + }, + { + "description": "[0.0] is valid", + "data": [0.0], + "valid": true + } + ] + }, { "description": "enum with 1 does not match true", "schema": { @@ -240,6 +312,30 @@ } ] }, + { + "description": "enum with [1] does not match [true]", + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "enum": [[1]] + }, + "tests": [ + { + "description": "[true] is invalid", + "data": [true], + "valid": false + }, + { + "description": "[1] is valid", + "data": [1], + "valid": true + }, + { + "description": "[1.0] is valid", + "data": [1.0], + "valid": true + } + ] + }, { "description": "nul characters in strings", "schema": { diff --git a/json/tests/draft2020-12/maxLength.json b/json/tests/draft2020-12/maxLength.json index b6eb03401..7462726d7 100644 --- a/json/tests/draft2020-12/maxLength.json +++ b/json/tests/draft2020-12/maxLength.json @@ -27,7 +27,7 @@ "valid": true }, { - "description": "two supplementary Unicode code points is long enough", + "description": "two graphemes is long enough", "data": "\uD83D\uDCA9\uD83D\uDCA9", "valid": true } diff --git a/json/tests/draft2020-12/minLength.json b/json/tests/draft2020-12/minLength.json index e0930b6fb..5076c5a92 100644 --- a/json/tests/draft2020-12/minLength.json +++ b/json/tests/draft2020-12/minLength.json @@ -27,7 +27,7 @@ "valid": true }, { - "description": "one supplementary Unicode code point is not long enough", + "description": "one grapheme is not long enough", "data": "\uD83D\uDCA9", "valid": false } diff --git a/json/tests/draft2020-12/unevaluatedItems.json b/json/tests/draft2020-12/unevaluatedItems.json index 276d7a5ba..ee0cb6586 100644 --- a/json/tests/draft2020-12/unevaluatedItems.json +++ b/json/tests/draft2020-12/unevaluatedItems.json @@ -461,6 +461,37 @@ } ] }, + { + "description": "unevaluatedItems before $ref", + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "unevaluatedItems": false, + "prefixItems": [ + { "type": "string" } + ], + "$ref": "#/$defs/bar", + "$defs": { + "bar": { + "prefixItems": [ + true, + { "type": "string" } + ] + } + } + }, + "tests": [ + { + "description": "with no unevaluated items", + "data": ["foo", "bar"], + "valid": true + }, + { + "description": "with unevaluated items", + "data": ["foo", "bar", "baz"], + "valid": false + } + ] + }, { "description": "unevaluatedItems with $dynamicRef", "schema": { diff --git a/json/tests/draft2020-12/unevaluatedProperties.json b/json/tests/draft2020-12/unevaluatedProperties.json index fcbbfa116..b8a2306ca 100644 --- a/json/tests/draft2020-12/unevaluatedProperties.json +++ b/json/tests/draft2020-12/unevaluatedProperties.json @@ -715,6 +715,44 @@ } ] }, + { + "description": "unevaluatedProperties before $ref", + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "unevaluatedProperties": false, + "properties": { + "foo": { "type": "string" } + }, + "$ref": "#/$defs/bar", + "$defs": { + "bar": { + "properties": { + "bar": { "type": "string" } + } + } + } + }, + "tests": [ + { + "description": "with no unevaluated properties", + "data": { + "foo": "foo", + "bar": "bar" + }, + "valid": true + }, + { + "description": "with unevaluated properties", + "data": { + "foo": "foo", + "bar": "bar", + "baz": "baz" + }, + "valid": false + } + ] + }, { "description": "unevaluatedProperties with $dynamicRef", "schema": { diff --git a/json/tests/draft3/maxLength.json b/json/tests/draft3/maxLength.json index 4de42bcab..b0a9ea5be 100644 --- a/json/tests/draft3/maxLength.json +++ b/json/tests/draft3/maxLength.json @@ -24,7 +24,7 @@ "valid": true }, { - "description": "two supplementary Unicode code points is long enough", + "description": "two graphemes is long enough", "data": "\uD83D\uDCA9\uD83D\uDCA9", "valid": true } diff --git a/json/tests/draft3/minLength.json b/json/tests/draft3/minLength.json index 3f09158de..6652c7509 100644 --- a/json/tests/draft3/minLength.json +++ b/json/tests/draft3/minLength.json @@ -24,7 +24,7 @@ "valid": true }, { - "description": "one supplementary Unicode code point is not long enough", + "description": "one grapheme is not long enough", "data": "\uD83D\uDCA9", "valid": false } diff --git a/json/tests/draft4/enum.json b/json/tests/draft4/enum.json index f085097be..ce43acc02 100644 --- a/json/tests/draft4/enum.json +++ b/json/tests/draft4/enum.json @@ -154,6 +154,27 @@ } ] }, + { + "description": "enum with [false] does not match [0]", + "schema": {"enum": [[false]]}, + "tests": [ + { + "description": "[false] is valid", + "data": [false], + "valid": true + }, + { + "description": "[0] is invalid", + "data": [0], + "valid": false + }, + { + "description": "[0.0] is invalid", + "data": [0.0], + "valid": false + } + ] + }, { "description": "enum with true does not match 1", "schema": {"enum": [true]}, @@ -175,6 +196,27 @@ } ] }, + { + "description": "enum with [true] does not match [1]", + "schema": {"enum": [[true]]}, + "tests": [ + { + "description": "[true] is valid", + "data": [true], + "valid": true + }, + { + "description": "[1] is invalid", + "data": [1], + "valid": false + }, + { + "description": "[1.0] is invalid", + "data": [1.0], + "valid": false + } + ] + }, { "description": "enum with 0 does not match false", "schema": {"enum": [0]}, @@ -196,6 +238,27 @@ } ] }, + { + "description": "enum with [0] does not match [false]", + "schema": {"enum": [[0]]}, + "tests": [ + { + "description": "[false] is invalid", + "data": [false], + "valid": false + }, + { + "description": "[0] is valid", + "data": [0], + "valid": true + }, + { + "description": "[0.0] is valid", + "data": [0.0], + "valid": true + } + ] + }, { "description": "enum with 1 does not match true", "schema": {"enum": [1]}, @@ -217,6 +280,27 @@ } ] }, + { + "description": "enum with [1] does not match [true]", + "schema": {"enum": [[1]]}, + "tests": [ + { + "description": "[true] is invalid", + "data": [true], + "valid": false + }, + { + "description": "[1] is valid", + "data": [1], + "valid": true + }, + { + "description": "[1.0] is valid", + "data": [1.0], + "valid": true + } + ] + }, { "description": "nul characters in strings", "schema": { "enum": [ "hello\u0000there" ] }, diff --git a/json/tests/draft4/maxLength.json b/json/tests/draft4/maxLength.json index 811d35b25..338795943 100644 --- a/json/tests/draft4/maxLength.json +++ b/json/tests/draft4/maxLength.json @@ -24,7 +24,7 @@ "valid": true }, { - "description": "two supplementary Unicode code points is long enough", + "description": "two graphemes is long enough", "data": "\uD83D\uDCA9\uD83D\uDCA9", "valid": true } diff --git a/json/tests/draft4/minLength.json b/json/tests/draft4/minLength.json index 3f09158de..6652c7509 100644 --- a/json/tests/draft4/minLength.json +++ b/json/tests/draft4/minLength.json @@ -24,7 +24,7 @@ "valid": true }, { - "description": "one supplementary Unicode code point is not long enough", + "description": "one grapheme is not long enough", "data": "\uD83D\uDCA9", "valid": false } diff --git a/json/tests/draft6/enum.json b/json/tests/draft6/enum.json index f085097be..ce43acc02 100644 --- a/json/tests/draft6/enum.json +++ b/json/tests/draft6/enum.json @@ -154,6 +154,27 @@ } ] }, + { + "description": "enum with [false] does not match [0]", + "schema": {"enum": [[false]]}, + "tests": [ + { + "description": "[false] is valid", + "data": [false], + "valid": true + }, + { + "description": "[0] is invalid", + "data": [0], + "valid": false + }, + { + "description": "[0.0] is invalid", + "data": [0.0], + "valid": false + } + ] + }, { "description": "enum with true does not match 1", "schema": {"enum": [true]}, @@ -175,6 +196,27 @@ } ] }, + { + "description": "enum with [true] does not match [1]", + "schema": {"enum": [[true]]}, + "tests": [ + { + "description": "[true] is valid", + "data": [true], + "valid": true + }, + { + "description": "[1] is invalid", + "data": [1], + "valid": false + }, + { + "description": "[1.0] is invalid", + "data": [1.0], + "valid": false + } + ] + }, { "description": "enum with 0 does not match false", "schema": {"enum": [0]}, @@ -196,6 +238,27 @@ } ] }, + { + "description": "enum with [0] does not match [false]", + "schema": {"enum": [[0]]}, + "tests": [ + { + "description": "[false] is invalid", + "data": [false], + "valid": false + }, + { + "description": "[0] is valid", + "data": [0], + "valid": true + }, + { + "description": "[0.0] is valid", + "data": [0.0], + "valid": true + } + ] + }, { "description": "enum with 1 does not match true", "schema": {"enum": [1]}, @@ -217,6 +280,27 @@ } ] }, + { + "description": "enum with [1] does not match [true]", + "schema": {"enum": [[1]]}, + "tests": [ + { + "description": "[true] is invalid", + "data": [true], + "valid": false + }, + { + "description": "[1] is valid", + "data": [1], + "valid": true + }, + { + "description": "[1.0] is valid", + "data": [1.0], + "valid": true + } + ] + }, { "description": "nul characters in strings", "schema": { "enum": [ "hello\u0000there" ] }, diff --git a/json/tests/draft6/maxLength.json b/json/tests/draft6/maxLength.json index 748b4daaf..be60c5407 100644 --- a/json/tests/draft6/maxLength.json +++ b/json/tests/draft6/maxLength.json @@ -24,7 +24,7 @@ "valid": true }, { - "description": "two supplementary Unicode code points is long enough", + "description": "two graphemes is long enough", "data": "\uD83D\uDCA9\uD83D\uDCA9", "valid": true } diff --git a/json/tests/draft6/minLength.json b/json/tests/draft6/minLength.json index 64db94805..23c68fe3f 100644 --- a/json/tests/draft6/minLength.json +++ b/json/tests/draft6/minLength.json @@ -24,7 +24,7 @@ "valid": true }, { - "description": "one supplementary Unicode code point is not long enough", + "description": "one grapheme is not long enough", "data": "\uD83D\uDCA9", "valid": false } diff --git a/json/tests/draft7/enum.json b/json/tests/draft7/enum.json index f085097be..ce43acc02 100644 --- a/json/tests/draft7/enum.json +++ b/json/tests/draft7/enum.json @@ -154,6 +154,27 @@ } ] }, + { + "description": "enum with [false] does not match [0]", + "schema": {"enum": [[false]]}, + "tests": [ + { + "description": "[false] is valid", + "data": [false], + "valid": true + }, + { + "description": "[0] is invalid", + "data": [0], + "valid": false + }, + { + "description": "[0.0] is invalid", + "data": [0.0], + "valid": false + } + ] + }, { "description": "enum with true does not match 1", "schema": {"enum": [true]}, @@ -175,6 +196,27 @@ } ] }, + { + "description": "enum with [true] does not match [1]", + "schema": {"enum": [[true]]}, + "tests": [ + { + "description": "[true] is valid", + "data": [true], + "valid": true + }, + { + "description": "[1] is invalid", + "data": [1], + "valid": false + }, + { + "description": "[1.0] is invalid", + "data": [1.0], + "valid": false + } + ] + }, { "description": "enum with 0 does not match false", "schema": {"enum": [0]}, @@ -196,6 +238,27 @@ } ] }, + { + "description": "enum with [0] does not match [false]", + "schema": {"enum": [[0]]}, + "tests": [ + { + "description": "[false] is invalid", + "data": [false], + "valid": false + }, + { + "description": "[0] is valid", + "data": [0], + "valid": true + }, + { + "description": "[0.0] is valid", + "data": [0.0], + "valid": true + } + ] + }, { "description": "enum with 1 does not match true", "schema": {"enum": [1]}, @@ -217,6 +280,27 @@ } ] }, + { + "description": "enum with [1] does not match [true]", + "schema": {"enum": [[1]]}, + "tests": [ + { + "description": "[true] is invalid", + "data": [true], + "valid": false + }, + { + "description": "[1] is valid", + "data": [1], + "valid": true + }, + { + "description": "[1.0] is valid", + "data": [1.0], + "valid": true + } + ] + }, { "description": "nul characters in strings", "schema": { "enum": [ "hello\u0000there" ] }, diff --git a/json/tests/draft7/maxLength.json b/json/tests/draft7/maxLength.json index 748b4daaf..be60c5407 100644 --- a/json/tests/draft7/maxLength.json +++ b/json/tests/draft7/maxLength.json @@ -24,7 +24,7 @@ "valid": true }, { - "description": "two supplementary Unicode code points is long enough", + "description": "two graphemes is long enough", "data": "\uD83D\uDCA9\uD83D\uDCA9", "valid": true } diff --git a/json/tests/draft7/minLength.json b/json/tests/draft7/minLength.json index 64db94805..23c68fe3f 100644 --- a/json/tests/draft7/minLength.json +++ b/json/tests/draft7/minLength.json @@ -24,7 +24,7 @@ "valid": true }, { - "description": "one supplementary Unicode code point is not long enough", + "description": "one grapheme is not long enough", "data": "\uD83D\uDCA9", "valid": false }