Skip to content

Commit fcdcf16

Browse files
committed
Merge branch 'dependentSchemas-fix'
* dependentSchemas-fix: validators: Fix dependentSchemas when instance is not an object
2 parents d0dd0fe + 12a92ea commit fcdcf16

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

jsonschema/_validators.py

+3
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,9 @@ def dependentRequired(validator, dependentRequired, instance, schema):
265265

266266

267267
def dependentSchemas(validator, dependentSchemas, instance, schema):
268+
if not validator.is_type(instance, "object"):
269+
return
270+
268271
for property, dependency in dependentSchemas.items():
269272
if property not in instance:
270273
continue

0 commit comments

Comments
 (0)