feat(api): OpenAPI documentation with Swagger UI
ci / image (pull_request) Successful in 2m22s
ci / build (pull_request) Successful in 6m46s
ci / lint (pull_request) Successful in 12m12s
ci / test (pull_request) Successful in 14m8s

/api/openapi.json is generated from a table of endpoints and the Go types
the handlers bind and return, including the limits of their binding
tags, so the document follows the code. A test fails for routes missing
from the table or documented but not served. /api/docs shows it with
Swagger UI from our own assets, usable without internet access; "Try it
out" works with the browser session.

Closes #84

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
Sebastian UnterschützandClaude Opus 5.5 committed 2026-11-22 13:03:07 +01:00
1 parent 0c2155fdc2
commit 6d3b1dea5d
18 files changed
+1207 -297

No files matched your search

+3
View File
@@ -88,6 +88,9 @@ func (s *Server) Mount(r gin.IRouter) {
g := r.Group("/", s.sessions.Load(), s.localize(), auth.CSRF(), s.audit())
r.GET("/api/openapi.json", s.openAPIJSON)
g.GET("/api/docs", s.apiDocsPage)
v1 := g.Group("/api/v1")
v1.POST("/locale", s.setLocale)
v1.POST("/markdown/preview", auth.Require(), s.previewMarkdown)