Closed marceloverdijk closed 2 weeks ago
Actually this was quite simple to do, but my approach above was wrong.
There was no need to install @hono/swagger-ui
nor to do app.get('/ui', swaggerUI({ url: '/doc' }));
.
Just use do this and it worked:
// Setup OpenAPI registry
const openapi = fromHono(app, {
docs_url: "/",
});
Looking at the Chanfana Minimal Hono Example
It uses the "normal" hono and zod imports, and not the
OpenAPIHono
from https://hono.dev/examples/zod-openapi which I assume is the recommended way with Canfana?To expose the SwaggerUI we can do:
but how to expose the openapi spec under
/doc
using Chanfana and Hono?