Validate an element of a collection against a previous element of that same collection
ffroliva opened this issue · 1 comments
ffroliva commented
Hi,
Is there a way to validate an element of a collection against a previous element of that same collection?
Let's say I have a list var list = List.of(1,2,3,4)
.
The element 1
at (index 0) should be validated against a default value (1) or against something like (0 +1). The next element 2
at (index 1) should be considered valid if its value is equal to list.get(0) +1.
There are multiple ways to solve this problem, I just want to know if the validator is able to access the other element from the same collection.
Thank you in advance.
making commented
You need to validate against the whole list