Skip to content

Commit

Permalink
Merge branch 'dependentSchemas-fix'
Browse files Browse the repository at this point in the history
* dependentSchemas-fix:
  validators: Fix dependentSchemas when instance is not an object
  • Loading branch information
Julian committed Oct 20, 2021
2 parents d0dd0fe + 12a92ea commit fcdcf16
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions jsonschema/_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,9 @@ def dependentRequired(validator, dependentRequired, instance, schema):


def dependentSchemas(validator, dependentSchemas, instance, schema):
if not validator.is_type(instance, "object"):
return

for property, dependency in dependentSchemas.items():
if property not in instance:
continue
Expand Down

0 comments on commit fcdcf16

Please sign in to comment.