Skip to content

Zod can not have an optional url #2801

Answered by colinhacks
Hasanovic-Kahya asked this question in Q&A
Discussion options

You must be logged in to vote

I'm not sure what is being asked. This is currently working as expected.

z.string().url().optional().parse(undefined)
// => undefined

Replies: 5 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Hasanovic-Kahya
Comment options

Answer selected by JacobWeisenburger
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@AuthorProxy
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants
Converted from issue

This discussion was converted from issue #2599 on September 25, 2023 13:53.