Closed HannesOberreiter closed 11 months ago
Can't that be done on schema level already?
Could not find how. :( The behaviour of strict
(if it should fail etc) you can modify at schema level, but not the passthrough
.
(Offtopic: big thanks on your work on knex and also helping in objection.js, love the libs!)
If you define your body schema as const myschema = z.object({ // definition }).passthrough()
, that doesn't suffice?
I not even tried to add passthrough on the object, as the documentation on zod shows the parser in the example and I blacked out. But it makes sense as it is a pipe on the object itself ...
Sorry about that, thanks for the help!
np!
Hi,
thanks for the great library. On some routes I would love to allow additional properties. Is there a way to modify the current compiler with a flag to do
schema.passthrough().parse();
?https://github.com/colinhacks/zod#passthrough
Thanks in advance!