Skip to content

How to combine validation plugin with prisma utils plugin? #1058

Closed Answered by hayes
jnssnmrcs asked this question in Q&A
Discussion options

You must be logged in to vote

After some debugging, this is an easy thing to run into, but I'm not sure if there is a good way to fix it.

zod.object() by default will strip out unknown properties. You need to do zod.object({...}).passthrough() if you are providing a partial schema. The nested schemas will run correctly, provided that the values are not stripped out by another schema.

Replies: 2 comments 6 replies

Comment options

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

Comment options

You must be logged in to vote
5 replies
@jnssnmrcs
Comment options

@jnssnmrcs
Comment options

@jnssnmrcs
Comment options

@jnssnmrcs
Comment options

@hayes
Comment options

hayes Oct 8, 2023
Maintainer

Answer selected by hayes
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