Replies: 1 comment 1 reply
-
Hi @nemanjam
Yeah, could you send PR about this feature? I think this is a common usage for everyone when using zod. Thanks. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have Zod schema that has booleans and numbers, not just strings.
And I use it to validate query string:
but
validatePostsGet()
middleware just does validation, all values inreq.query
remain strings after validation. So I need one additional step and helper function to convert strings to correct types which feels inconvenient and could be done in validation middleware and attached toreq.query.
likeparse()
from Zod does.Is it possible to add option to
withValidation()
to convert values to correct types?Beta Was this translation helpful? Give feedback.
All reactions