Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create min and max validators for number type #169

Open
Bobakanoosh opened this issue Jun 21, 2023 · 2 comments
Open

Create min and max validators for number type #169

Bobakanoosh opened this issue Jun 21, 2023 · 2 comments
Labels
Good First Issue Want to contribute? Just filter by this label Priority: Low Something worth considering, but not a top priority for the team Semver: Minor Mainly new features and improvements

Comments

@Bobakanoosh
Copy link

Bobakanoosh commented Jun 21, 2023

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

@RomainLanz RomainLanz added Semver: Minor Mainly new features and improvements Priority: Low Something worth considering, but not a top priority for the team Good First Issue Want to contribute? Just filter by this label labels Sep 11, 2023
@RomainLanz
Copy link
Member

Hey @Bobakanoosh! 👋🏻

I would happily accept a PR to add that!

@matheussss1
Copy link

@Bobakanoosh
actually you can use something like:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue Want to contribute? Just filter by this label Priority: Low Something worth considering, but not a top priority for the team Semver: Minor Mainly new features and improvements
Projects
None yet
Development

No branches or pull requests

3 participants