You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*`child` - A field instance that should be used for validating the objects in the list. If this argument is not provided then objects in the list will not be validated.
477
477
*`allow_empty` - Designates if empty lists are allowed.
478
478
*`min_length` - Validates that the list contains no fewer than this number of elements.
479
479
*`max_length` - Validates that the list contains no more than this number of elements.
480
+
*`max_depth` - Validates that nesting depth does not exceed this value. This applies to both the field schema depth and the raw input data depth. Depth of 0 permits the field itself but no nesting. Defaults to `None` (no limit).
480
481
481
482
For example, to validate a list of integers you might use something like the following:
482
483
@@ -495,10 +496,11 @@ We can now reuse our custom `StringListField` class throughout our application,
495
496
496
497
A field class that validates a dictionary of objects. The keys in `DictField` are always assumed to be string values.
*`child` - A field instance that should be used for validating the values in the dictionary. If this argument is not provided then values in the mapping will not be validated.
501
502
*`allow_empty` - Designates if empty dictionaries are allowed.
503
+
*`max_depth` - Validates that nesting depth does not exceed this value. This applies to both the field schema depth and the raw input data depth. Depth of 0 permits the field itself but no nesting. Defaults to `None` (no limit).
502
504
503
505
For example, to create a field that validates a mapping of strings to strings, you would write something like this:
0 commit comments