diff --git a/jsonschema/_validators.py b/jsonschema/_validators.py index 3929599ce..9a07f5ec3 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