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
My understanding is that Zod OpenAPI hono is simply an extension on top of the regular Hono, and so any Hono work should be compatible with OpenAPI Hono. As such I would expect the following to work using OpenAPIHono() (using the Hono JWT for example)-
However, TypeScript gives me a large type error on the app.use() line -
No overload matches this call.
Overload 1 of 2, '(...handlers: MiddlewareHandler<Env, never, {}>[]): Hono<Env, {}, "/">', gave the following error.
Argument of type 'string' is not assignable to parameter of type 'MiddlewareHandler<Env, never, {}>'.
Overload 2 of 2, '(path: "/fizz", ...handlers: MiddlewareHandler<Env, "/fizz", {}>[]): Hono<Env, {}, "/">', gave the following error.
Argument of type 'MiddlewareHandler' is not assignable to parameter of type 'MiddlewareHandler<Env, "/fizz", {}>'.
Types of parameters 'c' and 'c' are incompatible.
Type 'Context<Env, "/fizz", {}>' is not assignable to type 'Context<any, string, {}>'.
Types of property 'req' are incompatible.
Type 'HonoRequest<"/fizz", unknown>' is not assignable to type 'HonoRequest<string, unknown>'.
Types have separate declarations of a private property 'paramData'.ts(2769)
I am finding this error on any use of app.use(), not just for the JWT.
Following the README section of middleware - https://github.com/honojs/middleware/tree/main/packages/zod-openapi#middleware
My understanding is that Zod OpenAPI hono is simply an extension on top of the regular Hono, and so any Hono work should be compatible with OpenAPI Hono. As such I would expect the following to work using
OpenAPIHono()
(using the Hono JWT for example)-However, TypeScript gives me a large type error on the
app.use()
line -I am finding this error on any use of
app.use()
, not just for the JWT.If it is relevant, I am using bun
The text was updated successfully, but these errors were encountered: