New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow specific properties to be .required
#1176
Comments
+1 fo this, it is very common scenario. For example I have a |
+1 -- would like this so zod can mirror the TypeScript |
+1, I also needed this feature, thanks for your workaround @ivosabev |
Just implemented it in #1315. Can you please take a look, @colinhacks? |
.required
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Up |
Merged in #1315 |
I have a mySchema with ~10 properties.
In my API, I use
mySchema.partial()
as all props are optional, BUT one.I wish I could simply
mySchema.partial().required({ myRequired: true })
, as partial allows.It would be a better solution than .partial({ 9 props }) or merging with the mySchema.shape.myRequired.
The text was updated successfully, but these errors were encountered: