Skip to content

Conversation

braden-w
Copy link

@braden-w braden-w commented Jul 9, 2025

This PR adds Swagger UI support to the opencode server, providing an interactive API documentation interface.

Changes

  • Added @hono/swagger-ui dependency
  • Integrated Swagger UI middleware at /ui endpoint
  • 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!

CleanShot 2025-07-08 at 21 58 36

@adamdotdevin
Copy link
Contributor

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.

@braden-w
Copy link
Author

No problem! Yeah sorry if it was overwhelming haha

1 similar comment
@braden-w
Copy link
Author

No problem! Yeah sorry if it was overwhelming haha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants