Open api typescript error
Hello Guys
I'm using version 0.9.5 of @hono/zod-openapi. and I'm having that error, I tried to restart the typescript server, but the error keep appearing works perfectly when I run the server.
Hi @mandado
That is probably not a bug. It is possible that @hono/zod-openapi and hono are referring to different hono files. Please reinstall and try again.
This problem happens when I create a file like app.d.ts and includes on my tsconfig with the content:
declare module 'hono' {
interface ContextVariableMap {
result: string
}
}
seems like the typescript it not extending the interface ContextVariableMap .
the solution for that is:
export * from 'hono';
declare module 'hono' {
interface ContextVariableMap extends Record<string, string> {
result: string
}
}
@mandado
Or how about this?
import 'hono'
declare module 'hono' {
interface ContextVariableMap {
result: string
}
}
I don't think this is a problem that can be solved by changing the Hono code.