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

///zod.number.min() alias for ///zod.number.gte() missing #133

Closed
andenacitelli opened this issue Apr 23, 2023 · 2 comments
Closed

///zod.number.min() alias for ///zod.number.gte() missing #133

andenacitelli opened this issue Apr 23, 2023 · 2 comments

Comments

@andenacitelli
Copy link
Sponsor

I have this line in my Prisma schema:

currentUniversalCashbackPercentage Float                  @default(0) /// @zod.number.min(0).max(100)

I get this error on generating:

[@zod generator error]: Validator 'min' is not valid for type 'Float', for specified '@zod.[key] or for 'z.array.[key]'. [Error Location]: Model: 'Filters', Field: 'currentUniversalCashbackPercentage'.

Switching to gte() works fine. Relevant section of the zod docs: https://github.com/colinhacks/zod#numbers

@chrishoermann
Copy link
Owner

@andenacitelli is now implemented in latest version

@andenacitelli
Copy link
Sponsor Author

Nice, excellent work @chrishoermann!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants