feat(api): OpenAPI documentation with Swagger UI
/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:
1 parent
0c2155fdc2
commit
6d3b1dea5d
18 files changed
+1207
-297
No files matched your search
@@ -301,6 +301,7 @@ templ TokensPage(p Page, me Me, v TokensView) {
|
||||
} else {
|
||||
@settingsHeading("tokens.title", "tokens.intro")
|
||||
}
|
||||
<p class="-mt-4 mb-8 text-sm"><a href="/api/docs" class="underline underline-offset-2">{ i18n.T(ctx, "apidocs.title") }</a></p>
|
||||
if v.MaxDays > 0 {
|
||||
<p class="-mt-4 mb-8 text-sm">{ i18n.T(ctx, "tokens.policy", "Count", v.MaxDays) }</p>
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user