Got `unknown` type on res.json() on a OpenAPI RPC route
Hey ! I have an issue with RPC client and OpenAPI route inference.
Reproduction : https://stackblitz.com/edit/vitejs-vite-lqsp6pho?file=index.ts
Does someone had this problem before, or can someone help me?
Wishing you a good day 😉
Mattèo Gauthier
StackBlitz
RPC + @hono/zod-openapi type inference - StackBlitz
Next generation frontend tooling. It's fast!
2 Replies
in the openapi schema you've specified that the response could be a
200
or a 400
, so you need to handle each case:
Ah, I see. Thanks a lot; that makes sense !! Thanks for your time