fix: two reference defects the contract tests surfaced

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.
This commit is contained in:
AleFlyX
2026-11-26 21:39:05 +08:00
parent ce4cb1d200
commit 61e1be8d2f
3 changed files with 8 additions and 12 deletions

View File

@@ -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]))

View File

@@ -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 |

View File

@@ -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
| 方法 | 路径 |