File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55 In particular an applicator with a single subschema now produces the same best match as the bare subschema would.
66 ``relevance `` no longer considers an error's position amongst its siblings.
77 When subschemas fail equally deeply, the one which produced fewer errors is now preferred (#1002).
8+ * Errors produced by a ``false `` subschema now have the correct ``path `` and ``schema_path ``, rather than empty ones.
89* Accessing an index with no errors on an ``ErrorTree `` no longer causes that index to appear in the tree (#1328).
910 Subtrees also properly propagate lookup errors which were previously missing when accessing indices not in the subtree.
1011
Original file line number Diff line number Diff line change @@ -1316,6 +1316,34 @@ def test_boolean_schema_False(self):
13161316 ),
13171317 )
13181318
1319+ def test_nested_boolean_schema_False (self ):
1320+ schema = {"properties" : {"foo" : False }}
1321+ validator = validators .Draft7Validator (schema )
1322+ error , = validator .iter_errors ({"foo" : 12 })
1323+
1324+ self .assertEqual (
1325+ (
1326+ error .message ,
1327+ error .validator ,
1328+ error .validator_value ,
1329+ error .instance ,
1330+ error .schema ,
1331+ error .path ,
1332+ error .schema_path ,
1333+ error .json_path ,
1334+ ),
1335+ (
1336+ "False schema does not allow 12" ,
1337+ None ,
1338+ None ,
1339+ 12 ,
1340+ False ,
1341+ deque (["foo" ]),
1342+ deque (["properties" , "foo" ]),
1343+ "$.foo" ,
1344+ ),
1345+ )
1346+
13191347 def test_ref (self ):
13201348 ref , schema = "someRef" , {"additionalProperties" : {"type" : "integer" }}
13211349 validator = validators .Draft7Validator (
Original file line number Diff line number Diff line change @@ -410,6 +410,8 @@ def descend(
410410 validator_value = None ,
411411 instance = instance ,
412412 schema = schema ,
413+ path = () if path is None else (path ,),
414+ schema_path = () if schema_path is None else (schema_path ,),
413415 )
414416 return
415417
You can’t perform that action at this time.
0 commit comments