Skip to content
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

Input and Response Types #8

Closed
samchungy opened this issue Apr 17, 2023 · 0 comments · Fixed by #9
Closed

Input and Response Types #8

samchungy opened this issue Apr 17, 2023 · 0 comments · Fixed by #9

Comments

@samchungy
Copy link
Owner

samchungy commented Apr 17, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant