Replies: 1 comment 2 replies
-
Thanks for sharing your idea! I agree that the current solution is far from ideal and what you suggested is interesting. How would you handle |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I like the way, conform utilises Zod error messages to skip validation in certain cases (should be validated on the server or should be skipped at this point). Not a big fan of the code examples though.
After I've experimented for a while I found a nice way of having custom Zod schemas to do the same thing:
Than you can have a schema factory function like this:
This moves the distinction for skipping some validation to the caller side while also a more composable way of combining validations.
Maybe this is something we can add to conform? Let me know what you think!
Beta Was this translation helpful? Give feedback.
All reactions