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 @@ -395,9 +395,11 @@ def collect_validation(
395
395
schema : Dict ,
396
396
) -> FieldValidation :
397
397
# Validators in the main list data type are applied to the list overall.
398
-
399
398
validation = self ._constructor_validation (key , value )
400
399
400
+ if value is None and self .optional :
401
+ return validation
402
+
401
403
if len (self ._children ) == 0 :
402
404
return validation
403
405
@@ -435,9 +437,11 @@ def collect_validation(
435
437
schema : Dict ,
436
438
) -> FieldValidation :
437
439
# Validators in the main object data type are applied to the object overall.
438
-
439
440
validation = self ._constructor_validation (key , value )
440
441
442
+ if value is None and self .optional :
443
+ return validation
444
+
441
445
if len (self ._children ) == 0 :
442
446
return validation
443
447
You can’t perform that action at this time.
0 commit comments