Repository navigation
docs(api): OpenAPI annotations for the native API (WI-2032) - #250
thedancingdeveloper wants to merge 1 commit into
Conversation
|
Review of 767c0d5: no blockers, with 1 should-fix and nits. GitHub shows no checks on this PR at all (CI hasn't run), so re-trigger it before landing. Checks run locally:
Manifests. Completeness test: real
Spec accuracy: sampled six operations, all match their handlers
Secrets: noneThe diff contains no Should fix
Nits
|
`/swagger-ui` was mounted but documented nothing: ApiDoc carried only an
`info(...)` block, so `/api-docs/openapi.json` served empty `paths` and
`components`. AGENTS.md calls `/api/...` a compatibility surface documented
through utoipa, which was vacuous while no handler was annotated.
- Annotate every native handler with `#[utoipa::path]`, grouped by tag:
auth, system, setup, queue, history, statistics, config, servers,
categories, rss, groups, articles and dav.
- Derive `ToSchema` on the request/response and shared model types, with
`#[schema(value_type = String)]` for PathBuf fields. `ApiError` describes
the `{error_kind, human_readable, status}` body the middleware emits.
- Split ApiDoc into the always-present base and a `webdav`-gated DAV part,
merged in a manual `OpenApi` impl, so DAV paths appear only in builds that
serve them.
- Add `apps/rustnzb/tests/openapi_document.rs`: every route from the router
must appear in the document, no extra routes may appear, every operation
carries a tag, summary and response, the shared models are registered, and
every `async fn h_*` in a handler module carries an annotation.
- Enable utoipa's `chrono` feature for the shared config and model schemas.
The SABnzbd compatibility layer keeps its separate contract and is
deliberately outside the document.
Bumps nzb-nntp to 0.2.27 and nzb-web to 0.4.25.
767c0d5 to
729f3e3
Compare
|
Superseded by #257, which rebases this onto current The rebase also annotates the routes |
|
Superseded by #257 (rebased). |
Pull request was closed
WI-2032: documents all 92 native /api operations (plus 4 WebDAV ones when that feature is built) in the served OpenAPI spec, with a completeness test. Written by a DeepSeek worker.
🤖 Generated with Claude Code