Closed
Description
Range constraint is basically LessThan
and GreaterThan
, but it lacks a few things which I detail below.
- The error messages doesn't carry a notion of range at all.
Currently, there are 2 different error messages. One for when min
is not null
and the value is less than min
, and the other one for when max
is not null
and the value is greater than max
.
IMHO, we should have one more message that says something like This value should be between {{ lowerBound }} and {{ upperBound }}.
when max
and min
are not null
.
This way, it's clear that the value must be in the defined range.
- No property path support as in comparison constraints. (EDIT : PR is here [Validator] Allow to use property paths to get limits in range constraint #31511)
- No support for
LessThanOrEqual
andGreaterThanOrEqual
when comparing to bounds.
I can work on a (or multiple ?) PRs to add these features. WDYT ?