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
It seems like all the pieces are here, but I can't figure out if you can put them together.
I am using my own custom client via override.mutator and Orval uses this client to generated functions that match my API, which are typed according to the types it generates for the params, response, etc.
I am also able to generate the latter into Zod schemas.
Is it possible to generate functions that are typed via Zod schemas (via Zod.infer)?
Further, is it possible to rig things up to generate functions that actually parse the passed data with the same schemas it would use to type them? On success, call the custom fetch client, on fail, return the Zod Schema (or safeparse object)?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
It seems like all the pieces are here, but I can't figure out if you can put them together.
I am using my own custom client via
override.mutator
and Orval uses this client to generated functions that match my API, which are typed according to the types it generates for the params, response, etc.I am also able to generate the latter into Zod schemas.
Is it possible to generate functions that are typed via Zod schemas (via
Zod.infer
)?Further, is it possible to rig things up to generate functions that actually parse the passed data with the same schemas it would use to type them? On success, call the custom fetch client, on fail, return the Zod Schema (or safeparse object)?
Beta Was this translation helpful? Give feedback.
All reactions