import { OpenAPIHono } from '@hono/zod-openapi' import type { Schema } from 'hono' import type { AppBindings, AppOpenAPI } from './types.js' // Core framework function to create a router export function createRouter(): AppOpenAPI { return new OpenAPIHono({ strict: false, defaultHook: (result, c) => { if (!result.success) { return c.json( { success: false, error: result.error.flatten(), }, 422 ) } }, }) }