toZod package - Inferring schema from return type
Anyone have experience with the toZod package?
I've used it to infer schemas from types, but now I'm trying to infer a schema from a return type (generated from trpc's inferRouterOutputs):
Typically I use it like this:
Where if I just had this:
And if you hovered over ValueUnitSchema, you'd see all of the properties that you needed to define with all of the suggested schemas.
Now I'm trying to use it with an inferred router output type:
Upon hovering over TestSchema, I see this:
So I tried something like this:
Anyone have any clue on this?
0 Replies