File tree Expand file tree Collapse file tree 1 file changed +12
-12
lines changed
Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -302,18 +302,18 @@ def is_valid(errs_it):
302302 ),
303303 )
304304
305- for keyword in [
306- " properties" , "additionalProperties" , "unevaluatedProperties" ,
307- ]:
308- if keyword in schema :
309- schema_value = schema [ keyword ]
310- if validator . is_type ( schema_value , "boolean" ) and schema_value :
311- evaluated_keys += instance . keys ()
312-
313- elif validator . is_type ( schema_value , "object" ):
314- for property in schema_value :
315- if property in instance :
316- evaluated_keys . append ( property )
305+ properties = schema . get ( "properties" )
306+ if validator . is_type ( properties , "object" ):
307+ evaluated_keys += properties . keys () & instance . keys ()
308+
309+ for keyword in [ "additionalProperties" , "unevaluatedProperties" ]:
310+ if ( subschema := schema . get ( keyword )) is None :
311+ continue
312+ evaluated_keys += (
313+ key
314+ for key , value in instance . items ()
315+ if is_valid ( validator . descend ( value , subschema ))
316+ )
317317
318318 if "patternProperties" in schema :
319319 for property in instance :
You can’t perform that action at this time.
0 commit comments