diff options
author | Harald Nezbeda <hn@nezhar.com> | 2021-06-25 08:41:19 +0200 |
---|---|---|
committer | Harald Nezbeda <hn@nezhar.com> | 2021-07-20 17:08:47 +0200 |
commit | df1953ff50c16d7bad396b4e38677bbc0502c182 (patch) | |
tree | 72f22f9c2a564a585c42ba1fda31b399eb8e0361 /jsonschema/_validators.py | |
parent | f8555cd4a7458b0dd8c39f869d18c1b3cc67e816 (diff) | |
download | jsonschema-df1953ff50c16d7bad396b4e38677bbc0502c182.tar.gz |
Julian/jsonschema#782: Load dependencies from legacy validators
Diffstat (limited to 'jsonschema/_validators.py')
-rw-r--r-- | jsonschema/_validators.py | 24 |
1 files changed, 0 insertions, 24 deletions
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 |