min
Accepts numbers greater than or equal to the given minimum.Parameters
min- The minimum acceptable value (inclusive)decoder- Optional base decoder (defaults tonumber)
Validation Rules
- Value must be greater than or equal to
min - Inherits validation from the base decoder
Examples
Use Cases
- Age validation (minimum age requirement)
- Minimum price or amount
- Minimum quantity in stock
- Rating systems with lower bounds
max
Accepts numbers less than or equal to the given maximum.Parameters
max- The maximum acceptable value (inclusive)decoder- Optional base decoder (defaults tonumber)
Validation Rules
- Value must be less than or equal to
max - Inherits validation from the base decoder
Examples
Use Cases
- Maximum file size limits
- Maximum price or budget
- Percentage caps (e.g., max 100)
- Rate limiting thresholds
between
Accepts numbers within the given range (bounds are inclusive).Parameters
min- The minimum acceptable value (inclusive)max- The maximum acceptable value (inclusive)decoder- Optional base decoder (defaults tonumber)
Validation Rules
- Value must be greater than or equal to
min - Value must be less than or equal to
max - Inherits validation from the base decoder
Examples
Use Cases
- Age ranges (e.g., 18-65)
- Percentage values (0-100)
- Rating systems (e.g., 1-5 stars)
- Pagination limits
- Temperature ranges
- Port numbers (e.g., 1024-65535)
