We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 82b4a2e commit eff7404Copy full SHA for eff7404
guardrails/datatypes.py
@@ -399,9 +399,11 @@ def collect_validation(
399
schema: Dict,
400
) -> FieldValidation:
401
# Validators in the main list data type are applied to the list overall.
402
-
403
validation = self._constructor_validation(key, value)
404
+ if value is None and self.optional:
405
+ return validation
406
+
407
if len(self._children) == 0:
408
return validation
409
@@ -439,9 +441,11 @@ def collect_validation(
439
441
440
442
443
# Validators in the main object data type are applied to the object overall.
444
445
446
447
448
449
450
451
0 commit comments