@@ -275,26 +275,19 @@ def find_evaluated_property_keys_by_schema(validator, instance, schema):
275
275
"properties" , "additionalProperties" , "unevaluatedProperties" ,
276
276
]:
277
277
if keyword in schema :
278
- if validator .is_type (schema [keyword ], "boolean" ):
279
- for property , value in instance .items ():
280
- if validator .evolve (schema = schema [keyword ]).is_valid (
281
- {property : value },
282
- ):
283
- evaluated_keys .append (property )
278
+ schema_value = schema [keyword ]
279
+ if validator .is_type (schema_value , "boolean" ) and schema_value :
280
+ evaluated_keys += instance .keys ()
284
281
285
- if validator .is_type (schema [keyword ], "object" ):
286
- for property , subschema in schema [keyword ].items ():
287
- if property in instance and validator .evolve (
288
- schema = subschema ,
289
- ).is_valid (instance [property ]):
282
+ elif validator .is_type (schema_value , "object" ):
283
+ for property in schema_value :
284
+ if property in instance :
290
285
evaluated_keys .append (property )
291
286
292
287
if "patternProperties" in schema :
293
- for property , value in instance .items ():
294
- for pattern , _ in schema ["patternProperties" ].items ():
295
- if re .search (pattern , property ) and validator .evolve (
296
- schema = schema ["patternProperties" ],
297
- ).is_valid ({property : value }):
288
+ for property in instance :
289
+ for pattern in schema ["patternProperties" ]:
290
+ if re .search (pattern , property ):
298
291
evaluated_keys .append (property )
299
292
300
293
if "dependentSchemas" in schema :
0 commit comments