diff options
author | Julian Berman <Julian@GrayVines.com> | 2021-10-20 10:19:33 -0400 |
---|---|---|
committer | Julian Berman <Julian@GrayVines.com> | 2021-10-20 10:19:33 -0400 |
commit | fcdcf16c8d4341de35f18f1ab52d323f402039ea (patch) | |
tree | e8358263816766fc328084b30d78a466c574f288 | |
parent | d0dd0fe2af69218c9aef9c569fecb1947640b9ae (diff) | |
parent | 12a92ead0bac63f5b976b6f5f084c000f3493463 (diff) | |
download | jsonschema-fcdcf16c8d4341de35f18f1ab52d323f402039ea.tar.gz |
Merge branch 'dependentSchemas-fix'
* dependentSchemas-fix:
validators: Fix dependentSchemas when instance is not an object
-rw-r--r-- | jsonschema/_validators.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/jsonschema/_validators.py b/jsonschema/_validators.py index 3929599..9a07f5e 100644 --- a/jsonschema/_validators.py +++ b/jsonschema/_validators.py @@ -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 |