File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -399,9 +399,11 @@ def collect_validation(
399
399
schema : Dict ,
400
400
) -> FieldValidation :
401
401
# Validators in the main list data type are applied to the list overall.
402
-
403
402
validation = self ._constructor_validation (key , value )
404
403
404
+ if value is None and self .optional :
405
+ return validation
406
+
405
407
if len (self ._children ) == 0 :
406
408
return validation
407
409
@@ -439,9 +441,11 @@ def collect_validation(
439
441
schema : Dict ,
440
442
) -> FieldValidation :
441
443
# Validators in the main object data type are applied to the object overall.
442
-
443
444
validation = self ._constructor_validation (key , value )
444
445
446
+ if value is None and self .optional :
447
+ return validation
448
+
445
449
if len (self ._children ) == 0 :
446
450
return validation
447
451
You can’t perform that action at this time.
0 commit comments