From 61e1be8d2fa7b2cc1c0a77b6c369fb52f97dab20 Mon Sep 17 00:00:00 2001 From: AleFlyX <1449466458@qq.com> Date: Thu, 26 Nov 2026 21:39:05 +0800 Subject: [PATCH] fix: two reference defects the contract tests surfaced MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both are in the rewritten HTTP reference and both are the kind of thing a reader trusts because the page looks authoritative. **A path that is not served.** The Partners Manager block lists `GET /api/channels/schema/schema`; the router mounts `/api/partners/channels/schema`. Anyone following that table got a 404. **A heading for a router that serves nothing over HTTP.** `question:router` is mounted at `/api/question` and owns no HTTP endpoints — its module's endpoints live on `question_notebook:router`, and the socket half is on `/ws/questions`. The generator emitted a section with an empty table anyway, so the page advertised a prefix that answers nothing. Skip routers with no patterns and regenerate; the heading disappears from both locales. --- docs/scripts/generate_reference.py | 6 ++++++ docs/src/content/docs/developers/reference/http-api.md | 7 +------ .../content/docs/zh-cn/developers/reference/http-api.md | 7 +------ 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/docs/scripts/generate_reference.py b/docs/scripts/generate_reference.py index 496750982..c6fe36e0e 100644 --- a/docs/scripts/generate_reference.py +++ b/docs/scripts/generate_reference.py @@ -49,6 +49,12 @@ def route_index(locale: str) -> str: if mount is None: missing.append(reference) continue + # A router can be mounted with socket routes only (question:router owns + # none of the HTTP endpoints its module serves). Emitting a heading for + # it advertises a prefix that answers nothing over HTTP, which the doc + # contract tests then report as a documented path that is not served. + if not patterns: + continue groups.append((mount["module"], mount["prefix"], mount["auth"], reference, patterns)) groups.sort(key=lambda row: (row[0], row[1], row[3])) diff --git a/docs/src/content/docs/developers/reference/http-api.md b/docs/src/content/docs/developers/reference/http-api.md index 92d58d091..2d8b793f6 100644 --- a/docs/src/content/docs/developers/reference/http-api.md +++ b/docs/src/content/docs/developers/reference/http-api.md @@ -227,7 +227,7 @@ Provider profiles are edited through the catalog endpoints; there are not separa GET /api/partners POST /api/partners GET /api/partners/recent -GET /api/channels/schema/schema +GET /api/partners/channels/schema GET /api/partners/tool-options GET /api/partners/souls POST /api/partners/souls @@ -794,11 +794,6 @@ Generated from `deeptutor/modules/manifests/*.json` and `deeptutor/api/router_in ### questions -#### `question:router` — `/api/question` · learning - -| Method | Path | -| --- | --- | - #### `question_notebook:router` — `/api/question-notebook` · learning | Method | Path | diff --git a/docs/src/content/docs/zh-cn/developers/reference/http-api.md b/docs/src/content/docs/zh-cn/developers/reference/http-api.md index 8a1ac4200..1624ada33 100644 --- a/docs/src/content/docs/zh-cn/developers/reference/http-api.md +++ b/docs/src/content/docs/zh-cn/developers/reference/http-api.md @@ -227,7 +227,7 @@ Provider profile 通过 catalog endpoint 编辑;当前 API 里没有单独的 GET /api/partners POST /api/partners GET /api/partners/recent -GET /api/channels/schema/schema +GET /api/partners/channels/schema GET /api/partners/tool-options GET /api/partners/souls POST /api/partners/souls @@ -794,11 +794,6 @@ openapi-python-client generate --path deeptutor.openapi.json ### questions -#### `question:router` — `/api/question` · learning - -| 方法 | 路径 | -| --- | --- | - #### `question_notebook:router` — `/api/question-notebook` · learning | 方法 | 路径 |