@@ -77,7 +77,7 @@ def items(validator, items, instance, schema):
7777 if not items :
7878 if len (instance ) > len (schema ['prefixItems' ]):
7979 yield ValidationError (
80- "%r has more items than defined in prefixItems" % instance
80+ "%r has more items than defined in prefixItems" % instance ,
8181 )
8282 else :
8383 non_prefixed_items = instance [len (schema ['prefixItems' ]):] \
@@ -104,7 +104,7 @@ def additionalItems(validator, aI, instance, schema):
104104 error = "Additional items are not allowed (%s %s unexpected)"
105105 yield ValidationError (
106106 error %
107- extras_msg (instance [len (schema .get ("items" , [])):])
107+ extras_msg (instance [len (schema .get ("items" , [])):]),
108108 )
109109
110110
@@ -134,7 +134,7 @@ def contains(validator, contains, instance, schema):
134134 # default contains behavior
135135 if not matches :
136136 yield ValidationError (
137- "None of %r are valid under the given schema" % (instance ,)
137+ "None of %r are valid under the given schema" % (instance ,),
138138 )
139139 return
140140
@@ -143,8 +143,8 @@ def contains(validator, contains, instance, schema):
143143 yield ValidationError (
144144 "Too few matches under the given schema. "
145145 "Expected %d but there were only %d." % (
146- min_contains , matches
147- )
146+ min_contains , matches ,
147+ ),
148148 )
149149 return
150150
@@ -153,8 +153,8 @@ def contains(validator, contains, instance, schema):
153153 yield ValidationError (
154154 "Too many matches under the given schema. "
155155 "Expected %d but there were only %d." % (
156- max_contains , matches
157- )
156+ max_contains , matches ,
157+ ),
158158 )
159159 return
160160
@@ -163,8 +163,8 @@ def contains(validator, contains, instance, schema):
163163 yield ValidationError (
164164 "Invalid number or matches under the given schema, "
165165 "expected between %d and %d, got %d" % (
166- min_contains , max_contains , matches
167- )
166+ min_contains , max_contains , matches ,
167+ ),
168168 )
169169 return
170170
@@ -199,7 +199,7 @@ def minimum(validator, minimum, instance, schema):
199199
200200 if instance < minimum :
201201 yield ValidationError (
202- "%r is less than the minimum of %r" % (instance , minimum )
202+ "%r is less than the minimum of %r" % (instance , minimum ),
203203 )
204204
205205
@@ -209,7 +209,7 @@ def maximum(validator, maximum, instance, schema):
209209
210210 if instance > maximum :
211211 yield ValidationError (
212- "%r is greater than the maximum of %r" % (instance , maximum )
212+ "%r is greater than the maximum of %r" % (instance , maximum ),
213213 )
214214
215215
@@ -404,7 +404,7 @@ def required(validator, required, instance, schema):
404404def minProperties (validator , mP , instance , schema ):
405405 if validator .is_type (instance , "object" ) and len (instance ) < mP :
406406 yield ValidationError (
407- "%r does not have enough properties" % (instance ,)
407+ "%r does not have enough properties" % (instance ,),
408408 )
409409
410410
@@ -455,14 +455,14 @@ def oneOf(validator, oneOf, instance, schema):
455455 more_valid .append (first_valid )
456456 reprs = ", " .join (repr (schema ) for schema in more_valid )
457457 yield ValidationError (
458- "%r is valid under each of %s" % (instance , reprs )
458+ "%r is valid under each of %s" % (instance , reprs ),
459459 )
460460
461461
462462def not_ (validator , not_schema , instance , schema ):
463463 if validator .is_valid (instance , not_schema ):
464464 yield ValidationError (
465- "%r is not allowed for %r" % (not_schema , instance )
465+ "%r is not allowed for %r" % (not_schema , instance ),
466466 )
467467
468468
@@ -480,13 +480,13 @@ def if_(validator, if_schema, instance, schema):
480480
481481def unevaluatedItems (validator , unevaluatedItems , instance , schema ):
482482 evaluated_item_indexes = find_evaluated_item_indexes_by_schema (
483- validator , instance , schema
483+ validator , instance , schema ,
484484 )
485485 unevaluated_items = []
486486 for k , v in enumerate (instance ):
487487 if k not in evaluated_item_indexes :
488488 for error in validator .descend (
489- v , unevaluatedItems , schema_path = "unevaluatedItems"
489+ v , unevaluatedItems , schema_path = "unevaluatedItems" ,
490490 ):
491491 unevaluated_items .append (v )
492492
@@ -497,7 +497,7 @@ def unevaluatedItems(validator, unevaluatedItems, instance, schema):
497497
498498def unevaluatedProperties (validator , unevaluatedProperties , instance , schema ):
499499 evaluated_property_keys = find_evaluated_property_keys_by_schema (
500- validator , instance , schema
500+ validator , instance , schema ,
501501 )
502502 unevaluated_property_keys = []
503503 for property , subschema in instance .items ():
@@ -521,6 +521,6 @@ def prefixItems(validator, prefixItems, instance, schema):
521521
522522 for k , v in enumerate (instance [:min (len (prefixItems ), len (instance ))]):
523523 for error in validator .descend (
524- v , prefixItems [k ], schema_path = "prefixItems"
524+ v , prefixItems [k ], schema_path = "prefixItems" ,
525525 ):
526526 yield error
0 commit comments