Replies: 1 comment 2 replies
-
Are you trying to access it in your route? If so your |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've been working on implementing a validation middleware in Hono using Zod and
@hono/zod-validator
. Here's the code snippet of the middleware:And I use it like this:
The issue I'm facing is that I can't seem to get type safety on the return value. Specifically, when I try to use
c.req.valid('json')
, TypeScript throws the following error:I'm puzzled about why TypeScript is inferring never instead of the expected type. Could someone please advise on how to resolve this and ensure type safety in this scenario? Thanks!
Beta Was this translation helpful? Give feedback.
All reactions