You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Zod Schemas have some methods which generate different input and output types.
We need to add some logic to tell us we're in input generating mode versus output generating mode. This will help us generate parameters versus responses.
eg. with a transform we have an input type available but not an output type.
eg. z.string().transform((str) => str.length) we can tell we have a string input but not an output as we cannot infer the type of the transform.
Likewise with preprocess we can't tell what input we have but we know the output.
Same logic can be applied with .pipe
The text was updated successfully, but these errors were encountered:
Zod Schemas have some methods which generate different
input
andoutput
types.We need to add some logic to tell us we're in
input
generating mode versusoutput
generating mode. This will help us generate parameters versus responses.eg. with a
transform
we have aninput
type available but not anoutput
type.eg.
z.string().transform((str) => str.length)
we can tell we have astring
input but not an output as we cannot infer the type of the transform.Likewise with
preprocess
we can't tell what input we have but we know theoutput
.Same logic can be applied with
.pipe
The text was updated successfully, but these errors were encountered: