Skip to content

Add support for exclusivity in @range trait #3026

@timocov

Description

@timocov

Currently the @range trait only supports inclusive ranges i.e. both min and max values should be includes into the range. It would be nice to have a flag (for each min and max values separately) or maybe a different trait (so that we can combine the two) to support exclusive ranges. One of the use-cases could be to define a strongly positive/negative number (whilst it is possible to achieve with integer numbers b y simply add/deduct 1 which will make it less expressive imo, it is not possible to do with floating precision numbers). For instance, OpenAPI spec allows you to specify exclusiveMinimum and exclusiveMaximum flags if needed https://swagger.io/docs/specification/v3_0/data-models/data-types/#minimum-and-maximum.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestA feature should be added or improved.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions