Make Range and FieldRange validators have consistent logic and use default message key #930
Closed
3 tasks done
Labels
enhancement
A request for change or improvement to an existing feature
Milestone
Both
Range
andFieldRange
use"{org.kiwiproject.validation.Range|FieldRange.between.message}"
as the default formessage()
. This is problematic because:RangeValidator
andFieldRangeValidator
never use that message keyValidationMessages.properties
files does not contain this keyThese two validators actually use the above keys but suffixed with
minMaxValues
orminMaxLabels
. For exampleRange
uses:org.kiwiproject.validation.Range.between.message.minMaxValues
org.kiwiproject.validation.Range.between.message.minMaxLabels
It chooses which one based on whether there are labels or not.
Last, there is some weird logic in both these validators that appears to permit someone using them without specifying any of
min
,minLabel
,max
, ormaxLabel
, in that case it seems that the validator (at least@Range
) will then consider any value as valid. This is probably not what we want.@FieldRange
is different since it will compare two separate fields. However, its logic should be checked as well.So, the things in this task are to:
There might be more, but these are some first high-level tasks.
The text was updated successfully, but these errors were encountered: