Open markkkkas opened 4 weeks ago
Hi @markkkkas
Thank you for the issue. When we solve this problem, the type definition inside the Zod OpenAPI may be super complicated or verbose. I think finding a nice workaround is good for this issue, though I don't have an idea now.
Any updates on this?
Updates:
What I did to make it work was simply adding the AuthMiddlewareEnv
type to the OpenAPIHono
initiation, so it looks like this:
const router = new OpenAPIHono<AuthMiddlewareEnv>();
I'm not sure if this is scalable (as we need to do it on repeat). What do you think? @yusukebe
Hey, thanks for the neat tool for effortlessly building OpenAPI schemas. I've noticed (or maybe I'm doing something wrong) that middleware with context variables is not inferred at the route level when trying to access the route's context object.
Thanks in advance!