validator icon indicating copy to clipboard operation
validator copied to clipboard

Create `min` and `max` validators for number type

Open Bobakanoosh opened this issue 2 years ago • 2 comments

Why this feature is required (specific use-cases will be appreciated)?

For example, if I have a purchase, and want to enforce the purchase's amount to be greater than 0.

Have you tried any other work arounds?

I made my own custom rule, but figure it would be nice to have in the actual framework.

Are you willing to work on it with little guidance?

Yes

Bobakanoosh avatar Jun 21 '23 05:06 Bobakanoosh

Hey @Bobakanoosh! 👋🏻

I would happily accept a PR to add that!

RomainLanz avatar Sep 11 '23 19:09 RomainLanz

@Bobakanoosh actually you can use something like:

schema.number([rules.range(0, Infinity)]) #

matheussss1 avatar Jan 11 '24 22:01 matheussss1