I'm playing around Hono and RPC, and it works great, but for some reason the return type of the handler function is not enforced by the OpenAPI spec that is provided to it. I have searched on github issues and in here, but did not find anyone with the same problem. It might just be that it's not possible at the moment to do this automatically, but rather I have to type the
// definition200: { content: { 'application/json': { schema: z.object({ token: z.string() }) } },},// usage.openapi(routeDefinition, (c) => { // openapi return type is not being checked here // i would like this to return an error because it's not the same as the response definition return c.json({ not: 'the type above' }, 200);});
// definition200: { content: { 'application/json': { schema: z.object({ token: z.string() }) } },},// usage.openapi(routeDefinition, (c) => { // openapi return type is not being checked here // i would like this to return an error because it's not the same as the response definition return c.json({ not: 'the type above' }, 200);});