Skip to content

Async validation using Zod provider #4556

Answered by logaretm
re2005 asked this question in Q&A
Discussion options

You must be logged in to vote

Yep, the entire schema is re-run regardless of what field has changed. This may seem counter-intuitive but it is the most sound strategy in terms of validation correctness.

If you have refines that rely on other field values, they won't run unless the entire thing runs. So it's dangerous to assume we could validate each changed field in isolation.

It could be possible in upcoming releases since we started doing schema analysis in recent commits to get the "required" state. We could scan for "side effects" in the schema and determine if we can run each field/path validation schema in isolation.

For your case, a workaround is to use field-level validation schemas, you can pass each field it…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by re2005
Comment options

You must be logged in to vote
1 reply
@logaretm
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
2 participants