Apply numeric and length ranges
masterThe range constraint works for:
- Numeric types (
int,float,number): Validates the value itself. - Non-numeric types (
map,seq,str): Validates the length (len()) of the object.
Available keys:
min: Inclusive lower bound (a <= x)max: Inclusive upper bound (x <= b)min-ex: Exclusive lower bound (a < x)max-ex: Exclusive upper bound (x < b)
# Schema
type: map
mapping:
password:
type: str
range:
min: 8
max: 16
age:
type: int
range:
min: 18
max-ex: 30
# Data
password: foobar123
age: 25