We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 43f974c commit 037cb40Copy full SHA for 037cb40
guardrails/datatypes.py
@@ -395,9 +395,11 @@ def collect_validation(
395
schema: Dict,
396
) -> FieldValidation:
397
# Validators in the main list data type are applied to the list overall.
398
-
399
validation = self._constructor_validation(key, value)
400
+ if value is None and self.optional:
401
+ return validation
402
+
403
if len(self._children) == 0:
404
return validation
405
@@ -435,9 +437,11 @@ def collect_validation(
435
437
436
438
439
# Validators in the main object data type are applied to the object overall.
440
441
442
443
444
445
446
447
0 commit comments