We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When picking a subtype and marking it nullable, the generated zod schema loses the nullable attribute
export type foo = { bar: number; } export type bla = foo['bar'] | null
export const blaSchema = fooSchema.shape.bar.nullable();
export const blaSchema = fooSchema.shape.bar
Versions
4.9.3
3.21.4
The text was updated successfully, but these errors were encountered:
Hey, I guess you did a mistake writing the issue since the "Expected output" and "Actual output" are identical.
But running it locally, I can see than the actual output is the following:
export const fooSchema = z.object({ bar: z.number(), }); export const blaSchema = fooSchema.shape.bar;
Good catch!
Sorry, something went wrong.
Yes, sorry. I have updated the issue.
No branches or pull requests
Bug description
When picking a subtype and marking it nullable, the generated zod schema loses the nullable attribute
Input
Expected output
Actual output
Versions
4.9.3
3.21.4
The text was updated successfully, but these errors were encountered: