8000
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
Given the below code:
const myEnum = z.enum(["left", "right", "center", "justify"]); const myObject = z.object({ myEnum: myEnum }); type MyObject = z.infer<typeof myObject>; type MyObjectInput = z.input<typeof myObject>;
I would expect MyObjectInput to be of type:
type MyObjectInput = { myEnum: "left" | "right" | "center" | "justify"; }
The inferred type signature of MyObjectInput is shown as:
MyObjectInput
type MyObjectInput = { myEnum: z.core.$InferEnumInput<{ left: "left"; right: "right"; center: "center"; justify: "justify"; }>; }
NOTE: This is only an issue with MyObjectInput, not MyObject (i.e. output type).
MyObject
The text was updated successfully, but these errors were encountered:
Fixed in latest beta, go head any upgrade 👍
PS: Note that you'll need to rewrite your v4 imports to "zod/v4" after upgrading; for more information, see #4371 for details
"zod/v4"
Sorry, something went wrong.
No branches or pull requests
Description
Given the below code:
I would expect MyObjectInput to be of type:
Actual Result
The inferred type signature of
MyObjectInput
is shown as:NOTE: This is only an issue with
MyObjectInput
, notMyObject
(i.e. output type).The text was updated successfully, but these errors were encountered: