Extending existing interfaces #1184
Answered
by
TorbjornHoltmon
TorbjornHoltmon
asked this question in
Q&A
-
I have existing interfaces from a code gen, and I would like make a zod schema of these interfaces for parsing. Is this possible? const test = z.object<{ testy: number }>({
testy: z.number(),
}); i get the schema I want from this, but I get an error from typescript:
|
Beta Was this translation helpful? Give feedback.
Answered by
TorbjornHoltmon
Jun 2, 2022
Replies: 2 comments
-
Is this still the recommended approach? |
Beta Was this translation helpful? Give feedback.
0 replies
-
toZod solved my problem. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
TorbjornHoltmon
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
toZod solved my problem.
https://github.com/colinhacks/tozod