Replies: 1 comment 2 replies
-
Previously (in Zod 1) "nonstrict" meant that unrecognized keys were simply passed through to the output. To be clear, this isn't the current default behavior. By default, unrecognized keys get stripped out. Just want to make sure that's clear. I changed this because people were tired of putting Just added |
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 just found out Zod v2/v3 ignores unknown object fields by default.
For someone who wants more strictness everywhere:
.strict(...)
every time? Is there an easy way to have ESLint catch the mistake?z.strictObject
helper, just to make things a little easier to read?I'm also curious why the default changed to non-strict. Strictness by default was actually one of my requirements when I was deciding between validation libraries a year ago :-\
Beta Was this translation helpful? Give feedback.
All reactions