Skip to content

docs(api): add OpenAPI spec and interactive API explorer - #389

Merged
javi11 merged 1 commit into
mainfrom
session-d94d35
Mar 6, 2026
Merged

docs(api): add OpenAPI spec and interactive API explorer#389
javi11 merged 1 commit into
mainfrom
session-d94d35

Conversation

@javi11

@javi11 javi11 commented Mar 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Annotates all ~95 REST API handler functions with swaggo/swag doc comments across 17 handler files
  • Generates docs/static/swagger.yaml and docs/static/swagger.json from Go source annotations
  • Adds an interactive Swagger UI explorer page at /api-explorer (BrowserOnly, no SSG issues)
  • Adds API Explorer link to the Docusaurus navbar
  • Replaces the verbose endpoints.md stub with a concise overview pointing to the explorer
  • Adds gen-swagger script to docs/package.json to regenerate the spec after handler changes

How the spec is generated

go tool swag init \
  --generalInfo doc.go \
  --dir ./internal/api,./internal/database,./internal/config \
  --output docs/static \
  --outputTypes yaml,json \
  --parseInternal

Test plan

  • bun run build in docs/ passes without errors
  • Navigate to /api-explorer → Swagger UI loads with all 12 tag groups
  • Each endpoint shows correct parameters, response schemas, and security requirements
  • "Try it out" / "Execute" buttons work against a running AltMount instance

🤖 Generated with Claude Code

- Add swaggo/swag as a Go tool dependency (go.mod)
- Create internal/api/doc.go with global swag annotation block (12 tags, Bearer + ApiKey auth schemes)
- Annotate all ~95 handler functions across 17 handler files with swag comments (@summary, @tags, @PARAM, @success, @failure, @Security, @router)
- Generate docs/static/swagger.yaml and docs/static/swagger.json via swag init
- Add docs/src/pages/api-explorer.tsx: interactive Swagger UI page using BrowserOnly + swagger-ui-react
- Add API Explorer link to the Docusaurus navbar
- Add gen-swagger script to docs/package.json
- Replace verbose endpoints.md stub with concise overview + link to /api-explorer
- Add webpack stream polyfill plugin to docusaurus.config.ts for swagger-ui-react compatibility

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@javi11
javi11 merged commit b3591c8 into main Mar 6, 2026
2 checks passed
yoshitaka420 pushed a commit to yoshitaka420/altmount that referenced this pull request Jun 1, 2026
- Add swaggo/swag as a Go tool dependency (go.mod)
- Create internal/api/doc.go with global swag annotation block (12 tags, Bearer + ApiKey auth schemes)
- Annotate all ~95 handler functions across 17 handler files with swag comments (@summary, @tags, @PARAM, @success, @failure, @Security, @router)
- Generate docs/static/swagger.yaml and docs/static/swagger.json via swag init
- Add docs/src/pages/api-explorer.tsx: interactive Swagger UI page using BrowserOnly + swagger-ui-react
- Add API Explorer link to the Docusaurus navbar
- Add gen-swagger script to docs/package.json
- Replace verbose endpoints.md stub with concise overview + link to /api-explorer
- Add webpack stream polyfill plugin to docusaurus.config.ts for swagger-ui-react compatibility

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant