Zod can not have an optional url #2801
-
z.string().optional() is not a problem |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 2 replies
-
I just tried and it works just fine, what exactly does not work? Just a reminder that if you want to pass null you should use |
Beta Was this translation helpful? Give feedback.
-
same problem :(
same problem :( |
Beta Was this translation helpful? Give feedback.
-
I'm not sure what is being asked. This is currently working as expected. z.string().url().optional().parse(undefined)
// => undefined |
Beta Was this translation helpful? Give feedback.
-
@Hasanovic-Kahya or @amit548 |
Beta Was this translation helpful? Give feedback.
-
this is still doesn't work https://codepen.io/AuthorProxy/pen/KKJjxZX |
Beta Was this translation helpful? Give feedback.
I'm not sure what is being asked. This is currently working as expected.