types.middleware.validators¶
Between
¶
Validator to ensure that a value falls within a particular range
Type Constraints¶
- Supports Comparison (<, >, ==)
Source code in /home/runner/work/arc/arc/arc/types/middleware/validators.py
GreaterThan
¶
Validator to limit the maximum size of a value
Type Constraints¶
- Supports Comparison (<, >, ==)
Source code in /home/runner/work/arc/arc/arc/types/middleware/validators.py
Len
¶
Validator for the length of a value.
Len(4)
- Value must be length 4Len(1, 4)
- Value must be from length 1 to 4
Type Constraints¶
- Supports
len()
Note: If you find yourself doing something similar to Annotated[list[int], Len(2)]
,
it's generally going to be a bettter idea to do: tuple[int, int]
Source code in /home/runner/work/arc/arc/arc/types/middleware/validators.py
LessThan
¶
Validator to limit the minimum size of a value
Type Constraints¶
- Supports Comparison (<, >, ==)
Source code in /home/runner/work/arc/arc/arc/types/middleware/validators.py
Matches
¶
Validator to match a regular expression.
Type Constraints¶
- Matches against
str(value)
, so the type must have a sensible string representation