feat(server): add swagger ui support for api documentation
This PR adds Swagger UI support to the opencode server, providing an interactive API documentation interface.
Changes
- Added
@hono/swagger-uidependency - Integrated Swagger UI middleware at
/uiendpoint - UI automatically reads from existing OpenAPI spec at
/doc
Implementation
I followed the standard Hono Swagger UI documentation approach as shown in their official examples. This provides a clean, minimal integration that leverages our existing OpenAPI specification.
Proposal: support both Swagger UI and Scalar UI
See also #791 which implements Scalar UI on /scalar as an alternative documentation interface. Both UIs can coexist without conflict.
I believe we could support both documentation UIs simultaneously:
-
Swagger UI at
/ui- The industry standard that most developers are familiar with -
Scalar UI at
/scalar- A modern alternative with enhanced features
This would give users choice based on their preferences and use cases.
What do you think? Should we support both, or would you prefer to choose one? I'm open to discussion!
hey, sorry for the delay, giving me two options froze me lol. will discuss with the team this week, we also want to expose openapi docs on the website as well.
No problem! Yeah sorry if it was overwhelming haha
No problem! Yeah sorry if it was overwhelming haha