zod-prisma-types icon indicating copy to clipboard operation
zod-prisma-types copied to clipboard

decimal validation

Open michiim opened this issue 3 years ago • 1 comments

Would be great to have an easy solution for validation decimal "numbers" without using custom functions. Just like the way numbers are validated

ex. /// @zod.decimal.lt(10).gt(1)

michiim avatar Mar 21 '23 12:03 michiim

@michiim Thanks for the request. This is generally a good Idea but currently I do not plan to implement validators that are not natively supported by zod since this would require some major refactors in how the validators are handled and validated during generation.

I have not worked with decimals that much but I'd believe you, when you say that they can be a bit of a pain to work with when some advanced validation is needed. But for now please use this approach.

chrishoermann avatar Mar 27 '23 10:03 chrishoermann