-
Notifications
You must be signed in to change notification settings - Fork 278
Open
Labels
Description
Which middleware has the bug?
@hono/swagger-ui
What version of the middleware?
0.5.2
What version of Hono are you using?
4.9.8
What runtime/platform is your app running on? (with version if possible)
Node v20.19.2
What steps can reproduce the bug?
When using @hono/swagger-ui with the urls array, the UI renders but shows "No API definition provided." and does not auto-load a spec. Single url works as expected.
Environment
- Node: v20.19.2 (also tested with Bun 1.2.21)
- npm: 11.4.2
- hono: 4.9.8
- @hono/swagger-ui: 0.5.2
- @hono/zod-openapi: 1.1.3
Steps
- Create routes with
@hono/zod-openapiserving/v1/users/openapi.jsonand/v1/widgets/openapi.json. - Mount Swagger UI with only "urls":
app.get('/docs', swaggerUI({
urls: [
{ url: '/v1/users/openapi.json', name: 'Users API' },
{ url: '/v1/widgets/openapi.json', name: 'Widgets API' },
],
}))
- Navigate to
/docs. UI shows "No API definition provided."
Repro
https://github.com/frasergr/hono-swagger-ui-issue-example
What is the expected behavior?
With urls provided, the first entry should auto-load and there should be a way to select other entries.
What do you see instead?
/docs UI shows "No API definition provided."
Additional information
No response