Skip to content

[Validator] Various improvements proposal to Range constraint #31503

Closed
@Lctrs

Description

@Lctrs

Range constraint is basically LessThan and GreaterThan, but it lacks a few things which I detail below.

  1. 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.

  1. 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)
  2. No support for LessThanOrEqual and GreaterThanOrEqual when comparing to bounds.

I can work on a (or multiple ?) PRs to add these features. WDYT ?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions