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.
Currently the
@rangetrait 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 specifyexclusiveMinimumandexclusiveMaximumflags if needed https://swagger.io/docs/specification/v3_0/data-models/data-types/#minimum-and-maximum.