summaryrefslogtreecommitdiff
path: root/json
diff options
context:
space:
mode:
authorJulian Berman <Julian@GrayVines.com>2022-08-06 11:49:26 +0300
committerJulian Berman <Julian@GrayVines.com>2022-08-06 11:49:26 +0300
commit559aa6d73dea70e029c8e3dc33369548b19cb8eb (patch)
tree362b7c57cd44ee98426ca5ca8e56b0b09e2fb4a6 /json
parent08898c4b64c3084229cf5c5463365a11128ada5b (diff)
parent7a5fd08611cb2fb07b8200860a4e352eb33ae7bf (diff)
downloadjsonschema-559aa6d73dea70e029c8e3dc33369548b19cb8eb.tar.gz
Merge commit '7a5fd08611cb2fb07b8200860a4e352eb33ae7bf'
* commit '7a5fd08611cb2fb07b8200860a4e352eb33ae7bf': Squashed 'json/' changes from 2782d7c29..f82764080
Diffstat (limited to 'json')
-rwxr-xr-xjson/bin/jsonschema_suite136
-rw-r--r--json/tests/draft-next/anchor.json4
-rw-r--r--json/tests/draft-next/dynamicRef.json4
-rw-r--r--json/tests/draft-next/items.json10
-rw-r--r--json/tests/draft-next/optional/bignum.json4
-rw-r--r--json/tests/draft-next/optional/ecmascript-regex.json12
-rw-r--r--json/tests/draft-next/optional/format/date-time.json4
-rw-r--r--json/tests/draft-next/optional/format/date.json2
-rw-r--r--json/tests/draft-next/optional/format/duration.json2
-rw-r--r--json/tests/draft-next/optional/format/ipv4.json4
-rw-r--r--json/tests/draft-next/optional/format/ipv6.json4
-rw-r--r--json/tests/draft-next/optional/format/time.json2
-rw-r--r--json/tests/draft-next/prefixItems.json2
-rw-r--r--json/tests/draft-next/ref.json4
-rw-r--r--json/tests/draft2019-09/anchor.json4
-rw-r--r--json/tests/draft2019-09/items.json4
-rw-r--r--json/tests/draft2019-09/optional/bignum.json4
-rw-r--r--json/tests/draft2019-09/optional/ecmascript-regex.json12
-rw-r--r--json/tests/draft2019-09/optional/format/date-time.json4
-rw-r--r--json/tests/draft2019-09/optional/format/date.json2
-rw-r--r--json/tests/draft2019-09/optional/format/duration.json2
-rw-r--r--json/tests/draft2019-09/optional/format/ipv4.json4
-rw-r--r--json/tests/draft2019-09/optional/format/ipv6.json4
-rw-r--r--json/tests/draft2019-09/optional/format/time.json2
-rw-r--r--json/tests/draft2019-09/ref.json4
-rw-r--r--json/tests/draft2020-12/anchor.json4
-rw-r--r--json/tests/draft2020-12/dynamicRef.json4
-rw-r--r--json/tests/draft2020-12/items.json10
-rw-r--r--json/tests/draft2020-12/optional/bignum.json4
-rw-r--r--json/tests/draft2020-12/optional/ecmascript-regex.json12
-rw-r--r--json/tests/draft2020-12/optional/format/date-time.json4
-rw-r--r--json/tests/draft2020-12/optional/format/date.json2
-rw-r--r--json/tests/draft2020-12/optional/format/duration.json2
-rw-r--r--json/tests/draft2020-12/optional/format/ipv4.json4
-rw-r--r--json/tests/draft2020-12/optional/format/ipv6.json4
-rw-r--r--json/tests/draft2020-12/optional/format/time.json2
-rw-r--r--json/tests/draft2020-12/ref.json4
-rw-r--r--json/tests/draft3/optional/bignum.json38
-rw-r--r--json/tests/draft4/anyOf.json26
-rw-r--r--json/tests/draft4/optional/bignum.json4
-rw-r--r--json/tests/draft4/optional/ecmascript-regex.json12
-rw-r--r--json/tests/draft4/optional/format/date-time.json4
-rw-r--r--json/tests/draft4/optional/format/ipv4.json4
-rw-r--r--json/tests/draft4/optional/format/ipv6.json4
-rw-r--r--json/tests/draft4/ref.json4
-rw-r--r--json/tests/draft6/anyOf.json26
-rw-r--r--json/tests/draft6/optional/bignum.json4
-rw-r--r--json/tests/draft6/optional/ecmascript-regex.json12
-rw-r--r--json/tests/draft6/optional/format/date-time.json4
-rw-r--r--json/tests/draft6/optional/format/ipv4.json4
-rw-r--r--json/tests/draft6/optional/format/ipv6.json4
-rw-r--r--json/tests/draft7/anyOf.json26
-rw-r--r--json/tests/draft7/optional/bignum.json4
-rw-r--r--json/tests/draft7/optional/ecmascript-regex.json12
-rw-r--r--json/tests/draft7/optional/format/date-time.json4
-rw-r--r--json/tests/draft7/optional/format/date.json2
-rw-r--r--json/tests/draft7/optional/format/ipv4.json4
-rw-r--r--json/tests/draft7/optional/format/ipv6.json4
-rw-r--r--json/tests/draft7/optional/format/time.json2
-rw-r--r--json/tests/draft7/ref.json4
60 files changed, 242 insertions, 266 deletions
diff --git a/json/bin/jsonschema_suite b/json/bin/jsonschema_suite
index a859dcf..bd77ee4 100755
--- a/json/bin/jsonschema_suite
+++ b/json/bin/jsonschema_suite
@@ -40,14 +40,14 @@ def files(paths):
Each test file in the provided paths, as an array of test cases.
"""
for path in paths:
- yield json.loads(path.read_text())
+ yield path, json.loads(path.read_text())
def cases(paths):
"""
Each test case within each file in the provided paths.
"""
- for test_file in files(paths):
+ for _, test_file in files(paths):
yield from test_file
@@ -82,52 +82,115 @@ class SanityTests(unittest.TestCase):
assert cls.remote_files, "Didn't find the remote files!"
print(f"Found {len(cls.remote_files)} remote files")
+ def assertUnique(self, iterable):
+ """
+ Assert that the elements of an iterable are unique.
+ """
+
+ seen, duplicated = set(), set()
+ for each in iterable:
+ if each in seen:
+ duplicated.add(each)
+ seen.add(each)
+ self.assertFalse(duplicated, "Elements are not unique.")
+
def test_all_test_files_are_valid_json(self):
"""
All test files contain valid JSON.
"""
for path in self.test_files:
- try:
- json.loads(path.read_text())
- except ValueError as error:
- self.fail(f"{path} contains invalid JSON ({error})")
+ with self.subTest(path=path):
+ try:
+ json.loads(path.read_text())
+ except ValueError as error:
+ self.fail(f"{path} contains invalid JSON ({error})")
def test_all_remote_files_are_valid_json(self):
"""
All remote files contain valid JSON.
"""
for path in self.remote_files:
- try:
- json.loads(path.read_text())
- except ValueError as error:
- self.fail(f"{path} contains invalid JSON ({error})")
+ with self.subTest(path=path):
+ try:
+ json.loads(path.read_text())
+ except ValueError as error:
+ self.fail(f"{path} contains invalid JSON ({error})")
- def test_all_descriptions_have_reasonable_length(self):
+ def test_all_case_descriptions_have_reasonable_length(self):
+ """
+ All cases have reasonably long descriptions.
+ """
+ for case in cases(self.test_files):
+ with self.subTest(description=case["description"]):
+ self.assertLess(
+ len(case["description"]),
+ 150,
+ "Description is too long (keep it to less than 150 chars)."
+ )
+
+ def test_all_test_descriptions_have_reasonable_length(self):
"""
All tests have reasonably long descriptions.
"""
for count, test in enumerate(tests(self.test_files)):
- description = test["description"]
- self.assertLess(
- len(description),
- 70,
- f"{description!r} is too long! (keep it to less than 70 chars)"
- )
+ with self.subTest(description=test["description"]):
+ self.assertLess(
+ len(test["description"]),
+ 70,
+ "Description is too long (keep it to less than 70 chars)."
+ )
print(f"Found {count} tests.")
- def test_all_descriptions_are_unique(self):
+ def test_all_case_descriptions_are_unique(self):
+ """
+ All cases have unique descriptions in their files.
+ """
+ for path, cases in files(self.test_files):
+ with self.subTest(path=path):
+ self.assertUnique(case["description"] for case in cases)
+
+ def test_all_test_descriptions_are_unique(self):
"""
All test cases have unique test descriptions in their tests.
"""
for count, case in enumerate(cases(self.test_files)):
- descriptions = set(test["description"] for test in case["tests"])
- self.assertEqual(
- len(descriptions),
- len(case["tests"]),
- f"{case!r} contains a duplicate description",
- )
+ with self.subTest(description=case["description"]):
+ self.assertUnique(
+ test["description"] for test in case["tests"]
+ )
print(f"Found {count} test cases.")
+ def test_descriptions_do_not_use_modal_verbs(self):
+ """
+ Instead of saying "test that X frobs" or "X should frob" use "X frobs".
+
+ See e.g. https://jml.io/pages/test-docstrings.html
+
+ This test isn't comprehensive (it doesn't catch all the extra
+ verbiage there), but it's just to catch whatever it manages to
+ cover.
+ """
+
+ message = (
+ "In descriptions, don't say 'Test that X frobs' or 'X should "
+ "frob' or 'X should be valid'. Just say 'X frobs' or 'X is "
+ "valid'. It's shorter, and the test suite is entirely about "
+ "what *should* be already. "
+ "See https://jml.io/pages/test-docstrings.html for help."
+ )
+ for test in tests(self.test_files):
+ with self.subTest(description=test["description"]):
+ self.assertNotRegex(
+ test["description"],
+ r"\bshould\b",
+ message,
+ )
+ self.assertNotRegex(
+ test["description"],
+ r"(?i)\btest(s)? that\b",
+ message,
+ )
+
@unittest.skipIf(jsonschema is None, "Validation library not present!")
def test_all_schemas_are_valid(self):
"""
@@ -141,12 +204,14 @@ class SanityTests(unittest.TestCase):
if Validator is not None:
test_files = collect(version)
for case in cases(test_files):
- try:
- Validator.check_schema(case["schema"])
- except jsonschema.SchemaError as error:
- self.fail(
- f"{case} contains an invalid schema ({error})",
- )
+ with self.subTest(case=case):
+ try:
+ Validator.check_schema(case["schema"])
+ except jsonschema.SchemaError:
+ self.fail(
+ "Found an invalid schema."
+ "See the traceback for details on why."
+ )
else:
warnings.warn(f"No schema validator for {version.name}")
@@ -157,11 +222,12 @@ class SanityTests(unittest.TestCase):
"""
Validator = jsonschema.validators.validator_for(TESTSUITE_SCHEMA)
validator = Validator(TESTSUITE_SCHEMA)
- for tests in files(self.test_files):
- try:
- validator.validate(tests)
- except jsonschema.ValidationError as error:
- self.fail(str(error))
+ for path, cases in files(self.test_files):
+ with self.subTest(path=path):
+ try:
+ validator.validate(cases)
+ except jsonschema.ValidationError as error:
+ self.fail(str(error))
def main(arguments):
diff --git a/json/tests/draft-next/anchor.json b/json/tests/draft-next/anchor.json
index f0fcf02..9744a3c 100644
--- a/json/tests/draft-next/anchor.json
+++ b/json/tests/draft-next/anchor.json
@@ -159,12 +159,12 @@
},
"tests": [
{
- "description": "$ref should resolve to /$defs/A/allOf/1",
+ "description": "$ref resolves to /$defs/A/allOf/1",
"data": "a",
"valid": true
},
{
- "description": "$ref should not resolve to /$defs/A/allOf/0",
+ "description": "$ref does not resolve to /$defs/A/allOf/0",
"data": 1,
"valid": false
}
diff --git a/json/tests/draft-next/dynamicRef.json b/json/tests/draft-next/dynamicRef.json
index d022856..79f04b5 100644
--- a/json/tests/draft-next/dynamicRef.json
+++ b/json/tests/draft-next/dynamicRef.json
@@ -374,7 +374,7 @@
]
},
{
- "description": "Tests for implementation dynamic anchor and reference link. Reference should be independent of any possible ordering.",
+ "description": "$ref and $dynamicAnchor are independent of order - $defs first",
"schema": {
"$id": "http://localhost:1234/strict-extendible-allof-defs-first.json",
"allOf": [
@@ -424,7 +424,7 @@
]
},
{
- "description": "Tests for implementation dynamic anchor and reference link. Reference should be independent of any possible ordering.",
+ "description": "$ref and $dynamicAnchor are independent of order - $ref first",
"schema": {
"$id": "http://localhost:1234/strict-extendible-allof-ref-first.json",
"allOf": [
diff --git a/json/tests/draft-next/items.json b/json/tests/draft-next/items.json
index 1f0bdcf..01f20e6 100644
--- a/json/tests/draft-next/items.json
+++ b/json/tests/draft-next/items.json
@@ -214,7 +214,7 @@
]
},
{
- "description": "items should not look in applicators, valid case",
+ "description": "items does not look in applicators, valid case",
"schema": {
"allOf": [
{ "prefixItems": [ { "minimum": 3 } ] }
@@ -223,12 +223,12 @@
},
"tests": [
{
- "description": "prefixItems in allOf should not constrain items, invalid case",
+ "description": "prefixItems in allOf does not constrain items, invalid case",
"data": [ 3, 5 ],
"valid": false
},
{
- "description": "prefixItems in allOf should not constrain items, valid case",
+ "description": "prefixItems in allOf does not constrain items, valid case",
"data": [ 5, 5 ],
"valid": true
}
@@ -254,7 +254,7 @@
]
},
{
- "description": "items should properly handle null data",
+ "description": "items with null",
"schema": {
"items": {
"type": "null"
@@ -262,7 +262,7 @@
},
"tests": [
{
- "description": "null items allowed",
+ "description": "allows null elements",
"data": [ null ],
"valid": true
}
diff --git a/json/tests/draft-next/optional/bignum.json b/json/tests/draft-next/optional/bignum.json
index 3f49226..94b4a4e 100644
--- a/json/tests/draft-next/optional/bignum.json
+++ b/json/tests/draft-next/optional/bignum.json
@@ -43,7 +43,7 @@
]
},
{
- "description": "integer comparison",
+ "description": "maximum integer comparison",
"schema": { "maximum": 18446744073709551615 },
"tests": [
{
@@ -67,7 +67,7 @@
]
},
{
- "description": "integer comparison",
+ "description": "minimum integer comparison",
"schema": { "minimum": -18446744073709551615 },
"tests": [
{
diff --git a/json/tests/draft-next/optional/ecmascript-regex.json b/json/tests/draft-next/optional/ecmascript-regex.json
index 5bbfc45..9f79d42 100644
--- a/json/tests/draft-next/optional/ecmascript-regex.json
+++ b/json/tests/draft-next/optional/ecmascript-regex.json
@@ -7,12 +7,12 @@
},
"tests": [
{
- "description": "matches in Python, but should not in jsonschema",
+ "description": "matches in Python, but not in ECMA 262",
"data": "abc\\n",
"valid": false
},
{
- "description": "should match",
+ "description": "matches",
"data": "abc",
"valid": true
}
@@ -342,7 +342,7 @@
]
},
{
- "description": "unicode characters do not match ascii ranges",
+ "description": "pattern with ASCII ranges",
"schema": { "pattern": "[a-z]cole" },
"tests": [
{
@@ -395,7 +395,7 @@
]
},
{
- "description": "unicode digits are more than 0 through 9",
+ "description": "pattern with non-ASCII digits",
"schema": { "pattern": "^\\p{digit}+$" },
"tests": [
{
@@ -480,7 +480,7 @@
]
},
{
- "description": "unicode characters do not match ascii ranges",
+ "description": "patternProperties with ASCII ranges",
"schema": {
"type": "object",
"patternProperties": {
@@ -534,7 +534,7 @@
]
},
{
- "description": "unicode digits are more than 0 through 9",
+ "description": "patternProperties with non-ASCII digits",
"schema": {
"type": "object",
"patternProperties": {
diff --git a/json/tests/draft-next/optional/format/date-time.json b/json/tests/draft-next/optional/format/date-time.json
index f4f9933..0911273 100644
--- a/json/tests/draft-next/optional/format/date-time.json
+++ b/json/tests/draft-next/optional/format/date-time.json
@@ -119,12 +119,12 @@
"valid": false
},
{
- "description": "non-ascii digits should be rejected in the date portion",
+ "description": "invalid non-ASCII '৪' (a Bengali 4) in date portion",
"data": "1963-06-1৪T00:00:00Z",
"valid": false
},
{
- "description": "non-ascii digits should be rejected in the time portion",
+ "description": "invalid non-ASCII '৪' (a Bengali 4) in time portion",
"data": "1963-06-11T0৪:00:00Z",
"valid": false
}
diff --git a/json/tests/draft-next/optional/format/date.json b/json/tests/draft-next/optional/format/date.json
index b4f61ee..06c9ea0 100644
--- a/json/tests/draft-next/optional/format/date.json
+++ b/json/tests/draft-next/optional/format/date.json
@@ -214,7 +214,7 @@
"valid": true
},
{
- "description": "non-ascii digits should be rejected",
+ "description": "invalid non-ASCII '৪' (a Bengali 4)",
"data": "1963-06-1৪",
"valid": false
}
diff --git a/json/tests/draft-next/optional/format/duration.json b/json/tests/draft-next/optional/format/duration.json
index 741348a..a6acdc1 100644
--- a/json/tests/draft-next/optional/format/duration.json
+++ b/json/tests/draft-next/optional/format/duration.json
@@ -119,7 +119,7 @@
"valid": false
},
{
- "description": "non-ascii digits should be rejected",
+ "description": "invalid non-ASCII '২' (a Bengali 2)",
"data": "P২Y",
"valid": false
}
diff --git a/json/tests/draft-next/optional/format/ipv4.json b/json/tests/draft-next/optional/format/ipv4.json
index 6b166c7..4706581 100644
--- a/json/tests/draft-next/optional/format/ipv4.json
+++ b/json/tests/draft-next/optional/format/ipv4.json
@@ -64,7 +64,7 @@
"valid": false
},
{
- "description": "leading zeroes should be rejected, as they are treated as octals",
+ "description": "invalid leading zeroes, as they are treated as octals",
"comment": "see https://sick.codes/universal-netmask-npm-package-used-by-270000-projects-vulnerable-to-octal-input-data-server-side-request-forgery-remote-file-inclusion-local-file-inclusion-and-more-cve-2021-28918/",
"data": "087.10.0.1",
"valid": false
@@ -75,7 +75,7 @@
"valid": true
},
{
- "description": "non-ascii digits should be rejected",
+ "description": "invalid non-ASCII '২' (a Bengali 2)",
"data": "1২7.0.0.1",
"valid": false
}
diff --git a/json/tests/draft-next/optional/format/ipv6.json b/json/tests/draft-next/optional/format/ipv6.json
index 6379927..94368f2 100644
--- a/json/tests/draft-next/optional/format/ipv6.json
+++ b/json/tests/draft-next/optional/format/ipv6.json
@@ -194,12 +194,12 @@
"valid": false
},
{
- "description": "non-ascii digits should be rejected",
+ "description": "invalid non-ASCII '৪' (a Bengali 4)",
"data": "1:2:3:4:5:6:7:৪",
"valid": false
},
{
- "description": "non-ascii digits should be rejected in the ipv4 portion also",
+ "description": "invalid non-ASCII '৪' (a Bengali 4) in the IPv4 portion",
"data": "1:2::192.16৪.0.1",
"valid": false
}
diff --git a/json/tests/draft-next/optional/format/time.json b/json/tests/draft-next/optional/format/time.json
index 5011d78..3142587 100644
--- a/json/tests/draft-next/optional/format/time.json
+++ b/json/tests/draft-next/optional/format/time.json
@@ -189,7 +189,7 @@
"valid": false
},
{
- "description": "non-ascii digits should be rejected",
+ "description": "invalid non-ASCII '২' (a Bengali 2)",
"data": "1২:00:00Z",
"valid": false
}
diff --git a/json/tests/draft-next/prefixItems.json b/json/tests/draft-next/prefixItems.json
index f72da11..8dc58ed 100644
--- a/json/tests/draft-next/prefixItems.json
+++ b/json/tests/draft-next/prefixItems.json
@@ -79,7 +79,7 @@
]
},
{
- "description": "prefixItems should properly handle null data",
+ "description": "prefixItems properly handles null data",
"schema": {
"prefixItems": [
{
diff --git a/json/tests/draft-next/ref.json b/json/tests/draft-next/ref.json
index 05fea36..189eb41 100644
--- a/json/tests/draft-next/ref.json
+++ b/json/tests/draft-next/ref.json
@@ -567,12 +567,12 @@
},
"tests": [
{
- "description": "number should pass",
+ "description": "number is valid",
"data": 1,
"valid": true
},
{
- "description": "non-number should fail",
+ "description": "non-number is invalid",
"data": "a",
"valid": false
}
diff --git a/json/tests/draft2019-09/anchor.json b/json/tests/draft2019-09/anchor.json
index 4143d1f..7a9e32d 100644
--- a/json/tests/draft2019-09/anchor.json
+++ b/json/tests/draft2019-09/anchor.json
@@ -159,12 +159,12 @@
},
"tests": [
{
- "description": "$ref should resolve to /$defs/A/allOf/1",
+ "description": "$ref resolves to /$defs/A/allOf/1",
"data": "a",
"valid": true
},
{
- "description": "$ref should not resolve to /$defs/A/allOf/0",
+ "description": "$ref does not resolve to /$defs/A/allOf/0",
"data": 1,
"valid": false
}
diff --git a/json/tests/draft2019-09/items.json b/json/tests/draft2019-09/items.json
index 58992fc..c77ba0b 100644
--- a/json/tests/draft2019-09/items.json
+++ b/json/tests/draft2019-09/items.json
@@ -263,7 +263,7 @@
]
},
{
- "description": "array-form items should properly handle null data",
+ "description": "array-form items with null instance elements",
"schema": {
"items": [
{
@@ -273,7 +273,7 @@
},
"tests": [
{
- "description": "null items allowed",
+ "description": "allows null elements",
"data": [ null ],
"valid": true
}
diff --git a/json/tests/draft2019-09/optional/bignum.json b/json/tests/draft2019-09/optional/bignum.json
index 3f49226..94b4a4e 100644
--- a/json/tests/draft2019-09/optional/bignum.json
+++ b/json/tests/draft2019-09/optional/bignum.json
@@ -43,7 +43,7 @@
]
},
{
- "description": "integer comparison",
+ "description": "maximum integer comparison",
"schema": { "maximum": 18446744073709551615 },
"tests": [
{
@@ -67,7 +67,7 @@
]
},
{
- "description": "integer comparison",
+ "description": "minimum integer comparison",
"schema": { "minimum": -18446744073709551615 },
"tests": [
{
diff --git a/json/tests/draft2019-09/optional/ecmascript-regex.json b/json/tests/draft2019-09/optional/ecmascript-regex.json
index 1beb0b3..764248f 100644
--- a/json/tests/draft2019-09/optional/ecmascript-regex.json
+++ b/json/tests/draft2019-09/optional/ecmascript-regex.json
@@ -7,12 +7,12 @@
},
"tests": [
{
- "description": "matches in Python, but should not in jsonschema",
+ "description": "matches in Python, but not in ECMA 262",
"data": "abc\\n",
"valid": false
},
{
- "description": "should match",
+ "description": "matches",
"data": "abc",
"valid": true
}
@@ -342,7 +342,7 @@
]
},
{
- "description": "unicode characters do not match ascii ranges",
+ "description": "pattern with ASCII ranges",
"schema": { "pattern": "[a-z]cole" },
"tests": [
{
@@ -384,7 +384,7 @@
]
},
{
- "description": "unicode digits are more than 0 through 9",
+ "description": "pattern with non-ASCII digits",
"schema": { "pattern": "^\\p{digit}+$" },
"tests": [
{
@@ -469,7 +469,7 @@
]
},
{
- "description": "unicode characters do not match ascii ranges",
+ "description": "patternProperties with ASCII ranges",
"schema": {
"type": "object",
"patternProperties": {
@@ -523,7 +523,7 @@
]
},
{
- "description": "unicode digits are more than 0 through 9",
+ "description": "patternProperties with non-ASCII digits",
"schema": {
"type": "object",
"patternProperties": {
diff --git a/json/tests/draft2019-09/optional/format/date-time.json b/json/tests/draft2019-09/optional/format/date-time.json
index f4f9933..0911273 100644
--- a/json/tests/draft2019-09/optional/format/date-time.json
+++ b/json/tests/draft2019-09/optional/format/date-time.json
@@ -119,12 +119,12 @@
"valid": false
},
{
- "description": "non-ascii digits should be rejected in the date portion",
+ "description": "invalid non-ASCII '৪' (a Bengali 4) in date portion",
"data": "1963-06-1৪T00:00:00Z",
"valid": false
},
{
- "description": "non-ascii digits should be rejected in the time portion",
+ "description": "invalid non-ASCII '৪' (a Bengali 4) in time portion",
"data": "1963-06-11T0৪:00:00Z",
"valid": false
}
diff --git a/json/tests/draft2019-09/optional/format/date.json b/json/tests/draft2019-09/optional/format/date.json
index b4f61ee..06c9ea0 100644
--- a/json/tests/draft2019-09/optional/format/date.json
+++ b/json/tests/draft2019-09/optional/format/date.json
@@ -214,7 +214,7 @@
"valid": true
},
{
- "description": "non-ascii digits should be rejected",
+ "description": "invalid non-ASCII '৪' (a Bengali 4)",
"data": "1963-06-1৪",
"valid": false
}
diff --git a/json/tests/draft2019-09/optional/format/duration.json b/json/tests/draft2019-09/optional/format/duration.json
index 741348a..a6acdc1 100644
--- a/json/tests/draft2019-09/optional/format/duration.json
+++ b/json/tests/draft2019-09/optional/format/duration.json
@@ -119,7 +119,7 @@
"valid": false
},
{
- "description": "non-ascii digits should be rejected",
+ "description": "invalid non-ASCII '২' (a Bengali 2)",
"data": "P২Y",
"valid": false
}
diff --git a/json/tests/draft2019-09/optional/format/ipv4.json b/json/tests/draft2019-09/optional/format/ipv4.json
index 6b166c7..4706581 100644
--- a/json/tests/draft2019-09/optional/format/ipv4.json
+++ b/json/tests/draft2019-09/optional/format/ipv4.json
@@ -64,7 +64,7 @@
"valid": false
},
{
- "description": "leading zeroes should be rejected, as they are treated as octals",
+ "description": "invalid leading zeroes, as they are treated as octals",
"comment": "see https://sick.codes/universal-netmask-npm-package-used-by-270000-projects-vulnerable-to-octal-input-data-server-side-request-forgery-remote-file-inclusion-local-file-inclusion-and-more-cve-2021-28918/",
"data": "087.10.0.1",
"valid": false
@@ -75,7 +75,7 @@
"valid": true
},
{
- "description": "non-ascii digits should be rejected",
+ "description": "invalid non-ASCII '২' (a Bengali 2)",
"data": "1২7.0.0.1",
"valid": false
}
diff --git a/json/tests/draft2019-09/optional/format/ipv6.json b/json/tests/draft2019-09/optional/format/ipv6.json
index 6379927..94368f2 100644
--- a/json/tests/draft2019-09/optional/format/ipv6.json
+++ b/json/tests/draft2019-09/optional/format/ipv6.json
@@ -194,12 +194,12 @@
"valid": false
},
{
- "description": "non-ascii digits should be rejected",
+ "description": "invalid non-ASCII '৪' (a Bengali 4)",
"data": "1:2:3:4:5:6:7:৪",
"valid": false
},
{
- "description": "non-ascii digits should be rejected in the ipv4 portion also",
+ "description": "invalid non-ASCII '৪' (a Bengali 4) in the IPv4 portion",
"data": "1:2::192.16৪.0.1",
"valid": false
}
diff --git a/json/tests/draft2019-09/optional/format/time.json b/json/tests/draft2019-09/optional/format/time.json
index 5011d78..3142587 100644
--- a/json/tests/draft2019-09/optional/format/time.json
+++ b/json/tests/draft2019-09/optional/format/time.json
@@ -189,7 +189,7 @@
"valid": false
},
{
- "description": "non-ascii digits should be rejected",
+ "description": "invalid non-ASCII '২' (a Bengali 2)",
"data": "1২:00:00Z",
"valid": false
}
diff --git a/json/tests/draft2019-09/ref.json b/json/tests/draft2019-09/ref.json
index 32e3c66..6d1e90e 100644
--- a/json/tests/draft2019-09/ref.json
+++ b/json/tests/draft2019-09/ref.json
@@ -567,12 +567,12 @@
},
"tests": [
{
- "description": "number should pass",
+ "description": "number is valid",
"data": 1,
"valid": true
},
{
- "description": "non-number should fail",
+ "description": "non-number is invalid",
"data": "a",
"valid": false
}
diff --git a/json/tests/draft2020-12/anchor.json b/json/tests/draft2020-12/anchor.json
index 17e9080..8a6a5ea 100644
--- a/json/tests/draft2020-12/anchor.json
+++ b/json/tests/draft2020-12/anchor.json
@@ -159,12 +159,12 @@
},
"tests": [
{
- "description": "$ref should resolve to /$defs/A/allOf/1",
+ "description": "$ref resolves to /$defs/A/allOf/1",
"data": "a",
"valid": true
},
{
- "description": "$ref should not resolve to /$defs/A/allOf/0",
+ "description": "$ref does not resolve to /$defs/A/allOf/0",
"data": 1,
"valid": false
}
diff --git a/json/tests/draft2020-12/dynamicRef.json b/json/tests/draft2020-12/dynamicRef.json
index 618d836..3a51356 100644
--- a/json/tests/draft2020-12/dynamicRef.json
+++ b/json/tests/draft2020-12/dynamicRef.json
@@ -517,7 +517,7 @@
]
},
{
- "description": "Tests for implementation dynamic anchor and reference link. Reference should be independent of any possible ordering.",
+ "description": "$ref and $dynamicAnchor are independent of order - $defs first",
"schema": {
"$id": "http://localhost:1234/strict-extendible-allof-defs-first.json",
"allOf": [
@@ -567,7 +567,7 @@
]
},
{
- "description": "Tests for implementation dynamic anchor and reference link. Reference should be independent of any possible ordering.",
+ "description": "$ref and $dynamicAnchor are independent of order - $ref first",
"schema": {
"$id": "http://localhost:1234/strict-extendible-allof-ref-first.json",
"allOf": [
diff --git a/json/tests/draft2020-12/items.json b/json/tests/draft2020-12/items.json
index 1f0bdcf..38ab0e0 100644
--- a/json/tests/draft2020-12/items.json
+++ b/json/tests/draft2020-12/items.json
@@ -214,7 +214,7 @@
]
},
{
- "description": "items should not look in applicators, valid case",
+ "description": "items does not look in applicators, valid case",
"schema": {
"allOf": [
{ "prefixItems": [ { "minimum": 3 } ] }
@@ -223,12 +223,12 @@
},
"tests": [
{
- "description": "prefixItems in allOf should not constrain items, invalid case",
+ "description": "prefixItems in allOf does not constrain items, invalid case",
"data": [ 3, 5 ],
"valid": false
},
{
- "description": "prefixItems in allOf should not constrain items, valid case",
+ "description": "prefixItems in allOf does not constrain items, valid case",
"data": [ 5, 5 ],
"valid": true
}
@@ -254,7 +254,7 @@
]
},
{
- "description": "items should properly handle null data",
+ "description": "items with null instance elements",
"schema": {
"items": {
"type": "null"
@@ -262,7 +262,7 @@
},
"tests": [
{
- "description": "null items allowed",
+ "description": "allows null elements",
"data": [ null ],
"valid": true
}
diff --git a/json/tests/draft2020-12/optional/bignum.json b/json/tests/draft2020-12/optional/bignum.json
index 3f49226..94b4a4e 100644
--- a/json/tests/draft2020-12/optional/bignum.json
+++ b/json/tests/draft2020-12/optional/bignum.json
@@ -43,7 +43,7 @@
]
},
{
- "description": "integer comparison",
+ "description": "maximum integer comparison",
"schema": { "maximum": 18446744073709551615 },
"tests": [
{
@@ -67,7 +67,7 @@
]
},
{
- "description": "integer comparison",
+ "description": "minimum integer comparison",
"schema": { "minimum": -18446744073709551615 },
"tests": [
{
diff --git a/json/tests/draft2020-12/optional/ecmascript-regex.json b/json/tests/draft2020-12/optional/ecmascript-regex.json
index bb92acd..4d57efa 100644
--- a/json/tests/draft2020-12/optional/ecmascript-regex.json
+++ b/json/tests/draft2020-12/optional/ecmascript-regex.json
@@ -7,12 +7,12 @@
},
"tests": [
{
- "description": "matches in Python, but should not in jsonschema",
+ "description": "matches in Python, but not in ECMA 262",
"data": "abc\\n",
"valid": false
},
{
- "description": "should match",
+ "description": "matches",
"data": "abc",
"valid": true
}
@@ -342,7 +342,7 @@
]
},
{
- "description": "unicode characters do not match ascii ranges",
+ "description": "pattern with ASCII ranges",
"schema": { "pattern": "[a-z]cole" },
"tests": [
{
@@ -395,7 +395,7 @@
]
},
{
- "description": "unicode digits are more than 0 through 9",
+ "description": "pattern with non-ASCII digits",
"schema": { "pattern": "^\\p{digit}+$" },
"tests": [
{
@@ -480,7 +480,7 @@
]
},
{
- "description": "unicode characters do not match ascii ranges",
+ "description": "patternProperties with ASCII ranges",
"schema": {
"type": "object",
"patternProperties": {
@@ -534,7 +534,7 @@
]
},
{
- "description": "unicode digits are more than 0 through 9",
+ "description": "patternProperties with non-ASCII digits",
"schema": {
"type": "object",
"patternProperties": {
diff --git a/json/tests/draft2020-12/optional/format/date-time.json b/json/tests/draft2020-12/optional/format/date-time.json
index f4f9933..0911273 100644
--- a/json/tests/draft2020-12/optional/format/date-time.json
+++ b/json/tests/draft2020-12/optional/format/date-time.json
@@ -119,12 +119,12 @@
"valid": false
},
{
- "description": "non-ascii digits should be rejected in the date portion",
+ "description": "invalid non-ASCII '৪' (a Bengali 4) in date portion",
"data": "1963-06-1৪T00:00:00Z",
"valid": false
},
{
- "description": "non-ascii digits should be rejected in the time portion",
+ "description": "invalid non-ASCII '৪' (a Bengali 4) in time portion",
"data": "1963-06-11T0৪:00:00Z",
"valid": false
}
diff --git a/json/tests/draft2020-12/optional/format/date.json b/json/tests/draft2020-12/optional/format/date.json
index b4f61ee..06c9ea0 100644
--- a/json/tests/draft2020-12/optional/format/date.json
+++ b/json/tests/draft2020-12/optional/format/date.json
@@ -214,7 +214,7 @@
"valid": true
},
{
- "description": "non-ascii digits should be rejected",
+ "description": "invalid non-ASCII '৪' (a Bengali 4)",
"data": "1963-06-1৪",
"valid": false
}
diff --git a/json/tests/draft2020-12/optional/format/duration.json b/json/tests/draft2020-12/optional/format/duration.json
index 741348a..a6acdc1 100644
--- a/json/tests/draft2020-12/optional/format/duration.json
+++ b/json/tests/draft2020-12/optional/format/duration.json
@@ -119,7 +119,7 @@
"valid": false
},
{
- "description": "non-ascii digits should be rejected",
+ "description": "invalid non-ASCII '২' (a Bengali 2)",
"data": "P২Y",
"valid": false
}
diff --git a/json/tests/draft2020-12/optional/format/ipv4.json b/json/tests/draft2020-12/optional/format/ipv4.json
index 6b166c7..4706581 100644
--- a/json/tests/draft2020-12/optional/format/ipv4.json
+++ b/json/tests/draft2020-12/optional/format/ipv4.json
@@ -64,7 +64,7 @@
"valid": false
},
{
- "description": "leading zeroes should be rejected, as they are treated as octals",
+ "description": "invalid leading zeroes, as they are treated as octals",
"comment": "see https://sick.codes/universal-netmask-npm-package-used-by-270000-projects-vulnerable-to-octal-input-data-server-side-request-forgery-remote-file-inclusion-local-file-inclusion-and-more-cve-2021-28918/",
"data": "087.10.0.1",
"valid": false
@@ -75,7 +75,7 @@
"valid": true
},
{
- "description": "non-ascii digits should be rejected",
+ "description": "invalid non-ASCII '২' (a Bengali 2)",
"data": "1২7.0.0.1",
"valid": false
}
diff --git a/json/tests/draft2020-12/optional/format/ipv6.json b/json/tests/draft2020-12/optional/format/ipv6.json
index 6379927..94368f2 100644
--- a/json/tests/draft2020-12/optional/format/ipv6.json
+++ b/json/tests/draft2020-12/optional/format/ipv6.json
@@ -194,12 +194,12 @@
"valid": false
},
{
- "description": "non-ascii digits should be rejected",
+ "description": "invalid non-ASCII '৪' (a Bengali 4)",
"data": "1:2:3:4:5:6:7:৪",
"valid": false
},
{
- "description": "non-ascii digits should be rejected in the ipv4 portion also",
+ "description": "invalid non-ASCII '৪' (a Bengali 4) in the IPv4 portion",
"data": "1:2::192.16৪.0.1",
"valid": false
}
diff --git a/json/tests/draft2020-12/optional/format/time.json b/json/tests/draft2020-12/optional/format/time.json
index 5011d78..3142587 100644
--- a/json/tests/draft2020-12/optional/format/time.json
+++ b/json/tests/draft2020-12/optional/format/time.json
@@ -189,7 +189,7 @@
"valid": false
},
{
- "description": "non-ascii digits should be rejected",
+ "description": "invalid non-ASCII '২' (a Bengali 2)",
"data": "1২:00:00Z",
"valid": false
}
diff --git a/json/tests/draft2020-12/ref.json b/json/tests/draft2020-12/ref.json
index bc8ac44..d630047 100644
--- a/json/tests/draft2020-12/ref.json
+++ b/json/tests/draft2020-12/ref.json
@@ -567,12 +567,12 @@
},
"tests": [
{
- "description": "number should pass",
+ "description": "number is valid",
"data": 1,
"valid": true
},
{
- "description": "non-number should fail",
+ "description": "non-number is invalid",
"data": "a",
"valid": false
}
diff --git a/json/tests/draft3/optional/bignum.json b/json/tests/draft3/optional/bignum.json
index ccc7c17..1bc8eb2 100644
--- a/json/tests/draft3/optional/bignum.json
+++ b/json/tests/draft3/optional/bignum.json
@@ -1,30 +1,13 @@
[
{
"description": "integer",
- "schema": {"type": "integer"},
+ "schema": { "type": "integer" },
"tests": [
{
"description": "a bignum is an integer",
"data": 12345678910111213141516171819202122232425262728293031,
"valid": true
- }
- ]
- },
- {
- "description": "number",
- "schema": {"type": "number"},
- "tests": [
- {
- "description": "a bignum is a number",
- "data": 98249283749234923498293171823948729348710298301928331,
- "valid": true
- }
- ]
- },
- {
- "description": "integer",
- "schema": {"type": "integer"},
- "tests": [
+ },
{
"description": "a negative bignum is an integer",
"data": -12345678910111213141516171819202122232425262728293031,
@@ -34,9 +17,14 @@
},
{
"description": "number",
- "schema": {"type": "number"},
+ "schema": { "type": "number" },
"tests": [
{
+ "description": "a bignum is a number",
+ "data": 98249283749234923498293171823948729348710298301928331,
+ "valid": true
+ },
+ {
"description": "a negative bignum is a number",
"data": -98249283749234923498293171823948729348710298301928331,
"valid": true
@@ -45,7 +33,7 @@
},
{
"description": "string",
- "schema": {"type": "string"},
+ "schema": { "type": "string" },
"tests": [
{
"description": "a bignum is not a string",
@@ -55,8 +43,8 @@
]
},
{
- "description": "integer comparison",
- "schema": {"maximum": 18446744073709551615},
+ "description": "maximum integer comparison",
+ "schema": { "maximum": 18446744073709551615 },
"tests": [
{
"description": "comparison works for high numbers",
@@ -80,8 +68,8 @@
]
},
{
- "description": "integer comparison",
- "schema": {"minimum": -18446744073709551615},
+ "description": "minimum integer comparison",
+ "schema": { "minimum": -18446744073709551615 },
"tests": [
{
"description": "comparison works for very negative numbers",
diff --git a/json/tests/draft4/anyOf.json b/json/tests/draft4/anyOf.json
index f8d82e8..09cc3c2 100644
--- a/json/tests/draft4/anyOf.json
+++ b/json/tests/draft4/anyOf.json
@@ -152,31 +152,5 @@
"valid": false
}
]
- },
- {
- "description": "nested anyOf, to check validation semantics",
- "schema": {
- "anyOf": [
- {
- "anyOf": [
- {
- "type": "null"
- }
- ]
- }
- ]
- },
- "tests": [
- {
- "description": "null is valid",
- "data": null,
- "valid": true
- },
- {
- "description": "anything non-null is invalid",
- "data": 123,
- "valid": false
- }
- ]
}
]
diff --git a/json/tests/draft4/optional/bignum.json b/json/tests/draft4/optional/bignum.json
index 7a622de..1bc8eb2 100644
--- a/json/tests/draft4/optional/bignum.json
+++ b/json/tests/draft4/optional/bignum.json
@@ -43,7 +43,7 @@
]
},
{
- "description": "integer comparison",
+ "description": "maximum integer comparison",
"schema": { "maximum": 18446744073709551615 },
"tests": [
{
@@ -68,7 +68,7 @@
]
},
{
- "description": "integer comparison",
+ "description": "minimum integer comparison",
"schema": { "minimum": -18446744073709551615 },
"tests": [
{
diff --git a/json/tests/draft4/optional/ecmascript-regex.json b/json/tests/draft4/optional/ecmascript-regex.json
index 77624cf..9266c04 100644
--- a/json/tests/draft4/optional/ecmascript-regex.json
+++ b/json/tests/draft4/optional/ecmascript-regex.json
@@ -7,12 +7,12 @@
},
"tests": [
{
- "description": "matches in Python, but should not in jsonschema",
+ "description": "matches in Python, but not in ECMA 262",
"data": "abc\\n",
"valid": false
},
{
- "description": "should match",
+ "description": "matches",
"data": "abc",
"valid": true
}
@@ -342,7 +342,7 @@
]
},
{
- "description": "unicode characters do not match ascii ranges",
+ "description": "pattern with ASCII ranges",
"schema": { "pattern": "[a-z]cole" },
"tests": [
{
@@ -384,7 +384,7 @@
]
},
{
- "description": "unicode digits are more than 0 through 9",
+ "description": "pattern with non-ASCII digits",
"schema": { "pattern": "^\\p{digit}+$" },
"tests": [
{
@@ -469,7 +469,7 @@
]
},
{
- "description": "unicode characters do not match ascii ranges",
+ "description": "patternProperties with ASCII ranges",
"schema": {
"type": "object",
"patternProperties": {
@@ -523,7 +523,7 @@
]
},
{
- "description": "unicode digits are more than 0 through 9",
+ "description": "patternProperties with non-ASCII digits",
"schema": {
"type": "object",
"patternProperties": {
diff --git a/json/tests/draft4/optional/format/date-time.json b/json/tests/draft4/optional/format/date-time.json
index f4f9933..0911273 100644
--- a/json/tests/draft4/optional/format/date-time.json
+++ b/json/tests/draft4/optional/format/date-time.json
@@ -119,12 +119,12 @@
"valid": false
},
{
- "description": "non-ascii digits should be rejected in the date portion",
+ "description": "invalid non-ASCII '৪' (a Bengali 4) in date portion",
"data": "1963-06-1৪T00:00:00Z",
"valid": false
},
{
- "description": "non-ascii digits should be rejected in the time portion",
+ "description": "invalid non-ASCII '৪' (a Bengali 4) in time portion",
"data": "1963-06-11T0৪:00:00Z",
"valid": false
}
diff --git a/json/tests/draft4/optional/format/ipv4.json b/json/tests/draft4/optional/format/ipv4.json
index 6b166c7..4706581 100644
--- a/json/tests/draft4/optional/format/ipv4.json
+++ b/json/tests/draft4/optional/format/ipv4.json
@@ -64,7 +64,7 @@
"valid": false
},
{
- "description": "leading zeroes should be rejected, as they are treated as octals",
+ "description": "invalid leading zeroes, as they are treated as octals",
"comment": "see https://sick.codes/universal-netmask-npm-package-used-by-270000-projects-vulnerable-to-octal-input-data-server-side-request-forgery-remote-file-inclusion-local-file-inclusion-and-more-cve-2021-28918/",
"data": "087.10.0.1",
"valid": false
@@ -75,7 +75,7 @@
"valid": true
},
{
- "description": "non-ascii digits should be rejected",
+ "description": "invalid non-ASCII '২' (a Bengali 2)",
"data": "1২7.0.0.1",
"valid": false
}
diff --git a/json/tests/draft4/optional/format/ipv6.json b/json/tests/draft4/optional/format/ipv6.json
index 6379927..94368f2 100644
--- a/json/tests/draft4/optional/format/ipv6.json
+++ b/json/tests/draft4/optional/format/ipv6.json
@@ -194,12 +194,12 @@
"valid": false
},
{
- "description": "non-ascii digits should be rejected",
+ "description": "invalid non-ASCII '৪' (a Bengali 4)",
"data": "1:2:3:4:5:6:7:৪",
"valid": false
},
{
- "description": "non-ascii digits should be rejected in the ipv4 portion also",
+ "description": "invalid non-ASCII '৪' (a Bengali 4) in the IPv4 portion",
"data": "1:2::192.16৪.0.1",
"valid": false
}
diff --git a/json/tests/draft4/ref.json b/json/tests/draft4/ref.json
index d9978e9..b714fb0 100644
--- a/json/tests/draft4/ref.json
+++ b/json/tests/draft4/ref.json
@@ -493,12 +493,12 @@
},
"tests": [
{
- "description": "number should pass",
+ "description": "number is valid",
"data": 1,
"valid": true
},
{
- "description": "non-number should fail",
+ "description": "non-number is invalid",
"data": "a",
"valid": false
}
diff --git a/json/tests/draft6/anyOf.json b/json/tests/draft6/anyOf.json
index b720afa..ab5eb38 100644
--- a/json/tests/draft6/anyOf.json
+++ b/json/tests/draft6/anyOf.json
@@ -185,31 +185,5 @@
"valid": false
}
]
- },
- {
- "description": "nested anyOf, to check validation semantics",
- "schema": {
- "anyOf": [
- {
- "anyOf": [
- {
- "type": "null"
- }
- ]
- }
- ]
- },
- "tests": [
- {
- "description": "null is valid",
- "data": null,
- "valid": true
- },
- {
- "description": "anything non-null is invalid",
- "data": 123,
- "valid": false
- }
- ]
}
]
diff --git a/json/tests/draft6/optional/bignum.json b/json/tests/draft6/optional/bignum.json
index 3f49226..94b4a4e 100644
--- a/json/tests/draft6/optional/bignum.json
+++ b/json/tests/draft6/optional/bignum.json
@@ -43,7 +43,7 @@
]
},
{
- "description": "integer comparison",
+ "description": "maximum integer comparison",
"schema": { "maximum": 18446744073709551615 },
"tests": [
{
@@ -67,7 +67,7 @@
]
},
{
- "description": "integer comparison",
+ "description": "minimum integer comparison",
"schema": { "minimum": -18446744073709551615 },
"tests": [
{
diff --git a/json/tests/draft6/optional/ecmascript-regex.json b/json/tests/draft6/optional/ecmascript-regex.json
index 1beb0b3..764248f 100644
--- a/json/tests/draft6/optional/ecmascript-regex.json
+++ b/json/tests/draft6/optional/ecmascript-regex.json
@@ -7,12 +7,12 @@
},
"tests": [
{
- "description": "matches in Python, but should not in jsonschema",
+ "description": "matches in Python, but not in ECMA 262",
"data": "abc\\n",
"valid": false
},
{
- "description": "should match",
+ "description": "matches",
"data": "abc",
"valid": true
}
@@ -342,7 +342,7 @@
]
},
{
- "description": "unicode characters do not match ascii ranges",
+ "description": "pattern with ASCII ranges",
"schema": { "pattern": "[a-z]cole" },
"tests": [
{
@@ -384,7 +384,7 @@
]
},
{
- "description": "unicode digits are more than 0 through 9",
+ "description": "pattern with non-ASCII digits",
"schema": { "pattern": "^\\p{digit}+$" },
"tests": [
{
@@ -469,7 +469,7 @@
]
},
{
- "description": "unicode characters do not match ascii ranges",
+ "description": "patternProperties with ASCII ranges",
"schema": {
"type": "object",
"patternProperties": {
@@ -523,7 +523,7 @@
]
},
{
- "description": "unicode digits are more than 0 through 9",
+ "description": "patternProperties with non-ASCII digits",
"schema": {
"type": "object",
"patternProperties": {
diff --git a/json/tests/draft6/optional/format/date-time.json b/json/tests/draft6/optional/format/date-time.json
index f4f9933..0911273 100644
--- a/json/tests/draft6/optional/format/date-time.json
+++ b/json/tests/draft6/optional/format/date-time.json
@@ -119,12 +119,12 @@
"valid": false
},
{
- "description": "non-ascii digits should be rejected in the date portion",
+ "description": "invalid non-ASCII '৪' (a Bengali 4) in date portion",
"data": "1963-06-1৪T00:00:00Z",
"valid": false
},
{
- "description": "non-ascii digits should be rejected in the time portion",
+ "description": "invalid non-ASCII '৪' (a Bengali 4) in time portion",
"data": "1963-06-11T0৪:00:00Z",
"valid": false
}
diff --git a/json/tests/draft6/optional/format/ipv4.json b/json/tests/draft6/optional/format/ipv4.json
index 6b166c7..4706581 100644
--- a/json/tests/draft6/optional/format/ipv4.json
+++ b/json/tests/draft6/optional/format/ipv4.json
@@ -64,7 +64,7 @@
"valid": false
},
{
- "description": "leading zeroes should be rejected, as they are treated as octals",
+ "description": "invalid leading zeroes, as they are treated as octals",
"comment": "see https://sick.codes/universal-netmask-npm-package-used-by-270000-projects-vulnerable-to-octal-input-data-server-side-request-forgery-remote-file-inclusion-local-file-inclusion-and-more-cve-2021-28918/",
"data": "087.10.0.1",
"valid": false
@@ -75,7 +75,7 @@
"valid": true
},
{
- "description": "non-ascii digits should be rejected",
+ "description": "invalid non-ASCII '২' (a Bengali 2)",
"data": "1২7.0.0.1",
"valid": false
}
diff --git a/json/tests/draft6/optional/format/ipv6.json b/json/tests/draft6/optional/format/ipv6.json
index 6379927..94368f2 100644
--- a/json/tests/draft6/optional/format/ipv6.json
+++ b/json/tests/draft6/optional/format/ipv6.json
@@ -194,12 +194,12 @@
"valid": false
},
{
- "description": "non-ascii digits should be rejected",
+ "description": "invalid non-ASCII '৪' (a Bengali 4)",
"data": "1:2:3:4:5:6:7:৪",
"valid": false
},
{
- "description": "non-ascii digits should be rejected in the ipv4 portion also",
+ "description": "invalid non-ASCII '৪' (a Bengali 4) in the IPv4 portion",
"data": "1:2::192.16৪.0.1",
"valid": false
}
diff --git a/json/tests/draft7/anyOf.json b/json/tests/draft7/anyOf.json
index b720afa..ab5eb38 100644
--- a/json/tests/draft7/anyOf.json
+++ b/json/tests/draft7/anyOf.json
@@ -185,31 +185,5 @@
"valid": false
}
]
- },
- {
- "description": "nested anyOf, to check validation semantics",
- "schema": {
- "anyOf": [
- {
- "anyOf": [
- {
- "type": "null"
- }
- ]
- }
- ]
- },
- "tests": [
- {
- "description": "null is valid",
- "data": null,
- "valid": true
- },
- {
- "description": "anything non-null is invalid",
- "data": 123,
- "valid": false
- }
- ]
}
]
diff --git a/json/tests/draft7/optional/bignum.json b/json/tests/draft7/optional/bignum.json
index 3f49226..94b4a4e 100644
--- a/json/tests/draft7/optional/bignum.json
+++ b/json/tests/draft7/optional/bignum.json
@@ -43,7 +43,7 @@
]
},
{
- "description": "integer comparison",
+ "description": "maximum integer comparison",
"schema": { "maximum": 18446744073709551615 },
"tests": [
{
@@ -67,7 +67,7 @@
]
},
{
- "description": "integer comparison",
+ "description": "minimum integer comparison",
"schema": { "minimum": -18446744073709551615 },
"tests": [
{
diff --git a/json/tests/draft7/optional/ecmascript-regex.json b/json/tests/draft7/optional/ecmascript-regex.json
index 1beb0b3..764248f 100644
--- a/json/tests/draft7/optional/ecmascript-regex.json
+++ b/json/tests/draft7/optional/ecmascript-regex.json
@@ -7,12 +7,12 @@
},
"tests": [
{
- "description": "matches in Python, but should not in jsonschema",
+ "description": "matches in Python, but not in ECMA 262",
"data": "abc\\n",
"valid": false
},
{
- "description": "should match",
+ "description": "matches",
"data": "abc",
"valid": true
}
@@ -342,7 +342,7 @@
]
},
{
- "description": "unicode characters do not match ascii ranges",
+ "description": "pattern with ASCII ranges",
"schema": { "pattern": "[a-z]cole" },
"tests": [
{
@@ -384,7 +384,7 @@
]
},
{
- "description": "unicode digits are more than 0 through 9",
+ "description": "pattern with non-ASCII digits",
"schema": { "pattern": "^\\p{digit}+$" },
"tests": [
{
@@ -469,7 +469,7 @@
]
},
{
- "description": "unicode characters do not match ascii ranges",
+ "description": "patternProperties with ASCII ranges",
"schema": {
"type": "object",
"patternProperties": {
@@ -523,7 +523,7 @@
]
},
{
- "description": "unicode digits are more than 0 through 9",
+ "description": "patternProperties with non-ASCII digits",
"schema": {
"type": "object",
"patternProperties": {
diff --git a/json/tests/draft7/optional/format/date-time.json b/json/tests/draft7/optional/format/date-time.json
index f4f9933..0911273 100644
--- a/json/tests/draft7/optional/format/date-time.json
+++ b/json/tests/draft7/optional/format/date-time.json
@@ -119,12 +119,12 @@
"valid": false
},
{
- "description": "non-ascii digits should be rejected in the date portion",
+ "description": "invalid non-ASCII '৪' (a Bengali 4) in date portion",
"data": "1963-06-1৪T00:00:00Z",
"valid": false
},
{
- "description": "non-ascii digits should be rejected in the time portion",
+ "description": "invalid non-ASCII '৪' (a Bengali 4) in time portion",
"data": "1963-06-11T0৪:00:00Z",
"valid": false
}
diff --git a/json/tests/draft7/optional/format/date.json b/json/tests/draft7/optional/format/date.json
index b4f61ee..06c9ea0 100644
--- a/json/tests/draft7/optional/format/date.json
+++ b/json/tests/draft7/optional/format/date.json
@@ -214,7 +214,7 @@
"valid": true
},
{
- "description": "non-ascii digits should be rejected",
+ "description": "invalid non-ASCII '৪' (a Bengali 4)",
"data": "1963-06-1৪",
"valid": false
}
diff --git a/json/tests/draft7/optional/format/ipv4.json b/json/tests/draft7/optional/format/ipv4.json
index 6b166c7..4706581 100644
--- a/json/tests/draft7/optional/format/ipv4.json
+++ b/json/tests/draft7/optional/format/ipv4.json
@@ -64,7 +64,7 @@
"valid": false
},
{
- "description": "leading zeroes should be rejected, as they are treated as octals",
+ "description": "invalid leading zeroes, as they are treated as octals",
"comment": "see https://sick.codes/universal-netmask-npm-package-used-by-270000-projects-vulnerable-to-octal-input-data-server-side-request-forgery-remote-file-inclusion-local-file-inclusion-and-more-cve-2021-28918/",
"data": "087.10.0.1",
"valid": false
@@ -75,7 +75,7 @@
"valid": true
},
{
- "description": "non-ascii digits should be rejected",
+ "description": "invalid non-ASCII '২' (a Bengali 2)",
"data": "1২7.0.0.1",
"valid": false
}
diff --git a/json/tests/draft7/optional/format/ipv6.json b/json/tests/draft7/optional/format/ipv6.json
index 6379927..94368f2 100644
--- a/json/tests/draft7/optional/format/ipv6.json
+++ b/json/tests/draft7/optional/format/ipv6.json
@@ -194,12 +194,12 @@
"valid": false
},
{
- "description": "non-ascii digits should be rejected",
+ "description": "invalid non-ASCII '৪' (a Bengali 4)",
"data": "1:2:3:4:5:6:7:৪",
"valid": false
},
{
- "description": "non-ascii digits should be rejected in the ipv4 portion also",
+ "description": "invalid non-ASCII '৪' (a Bengali 4) in the IPv4 portion",
"data": "1:2::192.16৪.0.1",
"valid": false
}
diff --git a/json/tests/draft7/optional/format/time.json b/json/tests/draft7/optional/format/time.json
index 5011d78..3142587 100644
--- a/json/tests/draft7/optional/format/time.json
+++ b/json/tests/draft7/optional/format/time.json
@@ -189,7 +189,7 @@
"valid": false
},
{
- "description": "non-ascii digits should be rejected",
+ "description": "invalid non-ASCII '২' (a Bengali 2)",
"data": "1২:00:00Z",
"valid": false
}
diff --git a/json/tests/draft7/ref.json b/json/tests/draft7/ref.json
index 52e5168..dbf0595 100644
--- a/json/tests/draft7/ref.json
+++ b/json/tests/draft7/ref.json
@@ -634,12 +634,12 @@
},
"tests": [
{
- "description": "number should pass",
+ "description": "number is valid",
"data": 1,
"valid": true
},
{
- "description": "non-number should fail",
+ "description": "non-number is invalid",
"data": "a",
"valid": false
}