-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Calling isOptional
triggers preprocess callback
#1460
Comments
Maybe it's not an easy fix - looking thru code Line 439 in 4709160
If it's not possible to change, or if it's planned to work like this, this would be a documentation issue; in such a case it's needed to mention that .preprocess cb must be a pure function in docs |
Thank you for looking into this |
I believe this is "working as intended" and one of the gotchas for the Going to close for now, but feel free to keep the conversation alive if you have any further thoughts. |
I currently get by with |
@StefanTerdell is this the same problem as when using zod-to-json-schema with a schema such as this? const schema = z.object({
name: z.string().min(1),
email: z
.string()
.optional()
.refine(async () => Promise.resolve(true))
}); |
Calling
isOptional
triggers preprocess callback.Related to StefanTerdell/zod-to-json-schema#23.
Here's a failing test case:
The text was updated successfully, but these errors were encountered: