Skip to content

feat(server): add swagger ui support for api documentation - #790

Closed
braden-w wants to merge 3 commits into
anomalyco:devfrom
EpicenterHQ:feat/swagger-ui-support
Closed

braden-w wants to merge 3 commits into
anomalyco:devfrom
EpicenterHQ:feat/swagger-ui-support

Conversation

@braden-w

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

Copy link
Copy Markdown

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
Copy Markdown
Member

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
Copy Markdown
Author

No problem! Yeah sorry if it was overwhelming haha

1 similar comment
@braden-w

Copy link
Copy Markdown
Author

No problem! Yeah sorry if it was overwhelming haha

@github-actions
github-actions Bot force-pushed the dev branch 3 times, most recently from f1dc981 to 3e15a39 Compare November 22, 2025 18:07
@github-actions
github-actions Bot force-pushed the dev branch 3 times, most recently from f8ee907 to 6a9856d Compare November 27, 2025 01:29
@github-actions github-actions Bot closed this Nov 29, 2025
bussard76 pushed a commit to bussard76/openwork that referenced this pull request May 12, 2026
* fix: prevent session loss when switching workspaces

Add guard to prevent clearing sidebar sessions when the session store
temporarily returns empty during worker restart/reconnect. This fixes
the issue where sessions disappear from the sidebar when switching
between workspaces or refreshing the window.

Fixes anomalyco#750, anomalyco#735

* feat(app): add shouldUpdateSidebarSessions pure function with tests

Extract the guard logic from app.tsx into a testable pure function
to prevent session loss during workspace switches.

- Add `shouldUpdateSidebarSessions` to `lib/sidebar-sessions-guard.ts`
- Add test script `scripts/sidebar-sessions-guard.mjs` with 7 test cases
- Update app.tsx to use the extracted function
- Add `test:sidebar-sessions-guard` script to package.json

The guard prevents the sidebar from being cleared when the server
temporarily returns an empty session list during worker restart/reconnect.

Ref: anomalyco#750
bussard76 pushed a commit to bussard76/openwork that referenced this pull request May 12, 2026
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