Closed lounging-lizard closed 3 weeks ago
My apologies, I had not noticed that the inferred input type was in fact the issue, and the bug was due to my misunderstanding.
If anybody comes across this it is because the input component of z.ZodType
is inferred from the output component of the generic.
Description
When defining the schema shape using a type (
const Schema: z.ZodType<MyType> = ...
) Typescript is raises an error when using a schema and the pipe method.I believe it to be a bug as the correct type is inferred from the schema.
Example
Zod Version 3.23.8