From df1953ff50c16d7bad396b4e38677bbc0502c182 Mon Sep 17 00:00:00 2001 From: Harald Nezbeda Date: Fri, 25 Jun 2021 08:41:19 +0200 Subject: Julian/jsonschema#782: Load dependencies from legacy validators --- jsonschema/_validators.py | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'jsonschema/_validators.py') diff --git a/jsonschema/_validators.py b/jsonschema/_validators.py index 588d957..093aaba 100644 --- a/jsonschema/_validators.py +++ b/jsonschema/_validators.py @@ -301,30 +301,6 @@ def maxLength(validator, mL, instance, schema): yield ValidationError("%r is too long" % (instance,)) -def dependencies(validator, dependencies, instance, schema): - """ - The dependencies keyword has been deprecated since draft 2019-09 and has been split into dependentRequired - and dependentSchemas. - """ - if not validator.is_type(instance, "object"): - return - - for property, dependency in dependencies.items(): - if property not in instance: - continue - - if validator.is_type(dependency, "array"): - for each in dependency: - if each not in instance: - message = "%r is a dependency of %r" - yield ValidationError(message % (each, property)) - else: - for error in validator.descend( - instance, dependency, schema_path=property, - ): - yield error - - def dependentRequired(validator, dependentRequired, instance, schema): """ Split from dependencies -- cgit v1.2.1