# HG changeset patch # User Franz Glasner # Date 1689772763 -7200 # Node ID 2376224a97179dae8a730800a9c8b2359f88e5e5 # Parent 78f5ef0ee0877111bdafef756c0d7f4c88c88a7f FIX: when processing schema references and the resolved schema contains conditionals they must be evaluated diff -r 78f5ef0ee087 -r 2376224a9717 data_schema/__init__.py --- a/data_schema/__init__.py Wed Jul 19 14:19:21 2023 +0200 +++ b/data_schema/__init__.py Wed Jul 19 15:19:23 2023 +0200 @@ -1155,6 +1155,13 @@ def process_schema_references(schema, context, check_single_ref_key=True): + """ + + .. note:: If a new dereferenced schema is found schema conditionals are + evaluated also. So the resolved schema containing conditionals + behaves according to the given conditions. + + """ try: ref = schema[SCHEMA_REF_KEY] except (KeyError, TypeError): @@ -1167,6 +1174,8 @@ raise SchemaError( "dereferenced schema is not a `_Schema': {}".format(ref)) schema = copy.deepcopy(schema) + # process schema conditionals "cond" and "match" again + schema = process_schema_conditionals(schema, context) return process_schema_references(schema, context, check_single_ref_key=True)