Swagger-generated API documentation does not accurately describe the current API surface
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- ドキュメント
- 明瞭さ
- 説明が足りない
- 活発さ
- 静か
- 技術スタック
- go
- 領域
- api, backend, documentation
調査の方向性
まず、internal/controller と internal/controller_admin のハンドラーとアノテーションを、docs/swagger.json、docs/swagger.yaml、docs/docs.go と比較します。ドキュメント化されていないルートと内容の浅いレスポンスを確認し、そのうえでアノテーションと生成されたアーティファクトを整合させ、生成されたリファレンスが、役立つレスポンス、失敗時の内容、一貫したタグを含め、現在の API サーフェスを網羅するようにします。
索引モデルが issue の本文から書いたものです。
説明
Background
Apache Answer uses swaggo/swag to generate its REST API documentation from annotations in the Go controllers. The generated artifacts (docs/swagger.json, docs/swagger.yaml, and docs/docs.go) are intended to be the authoritative API reference for contributors, integrators, and third-party developers. However, the source annotations have drifted away from the actual implementation over time, so the generated docs no longer fulfill that role.
Current Situation
The codebase currently has roughly 50 controller files under internal/controller and internal/controller_admin, exposing approximately 221 HTTP routes. The generated docs/swagger.json contains only 161 paths, meaning a significant portion of the API is undocumented. Several controller files, including those for newer features such as AI chat completions, user-center plugins, and MCP tools, contain HTTP handlers with no Swag annotations at all.
For the endpoints that are documented, the annotations are often too shallow to be useful. @Description frequently repeats @Summary verbatim (for example, “delete question” or “GetOtherUserInfoByUsername”), giving callers no insight into behavior, required permissions, side effects, or valid parameter values. Many list and detail endpoints declare their success response as a bare string placeholder ({string} string "") instead of the real response schema, so consumers cannot see the actual field structure they will receive. No controller file currently uses @Failure, so error status codes, reason codes, and error body shapes are entirely absent from the documentation.
Tags are also applied inconsistently. Related endpoints are grouped under different tag names, and the generated swagger.json currently contains no top-level tag definitions, which prevents the Swagger UI from presenting the API in a clean, navigable structure.
Why This Needs to Be Fixed
Accurate API documentation is essential for an open-source project like Apache Answer. New contributors need it to understand the system without reading every handler. Third-party developers and client applications need it to integrate correctly. When the generated Swagger docs are incomplete or misleading, integration work becomes slower and more error-prone, and undocumented endpoints effectively become hidden private APIs that are risky to change or maintain.
The goal is to bring the Swag annotations and the generated Swagger artifacts back into alignment with the real API, so that docs/swagger.json and docs/swagger.yaml can serve as a complete, correct, and usable API reference.
- 主要言語
- Go
- スター
- 15.7k
- フォーク
- 1.4k
- 平均マージ
- 1日 20時間
- マージ済み PR(30日)
- 6
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/answer のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
Hardening: cap the invite_user list size in UpdateQuestionInviteUser to bound notification fan-out オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
Gravatar hash is computed from the un-lowercased email, so mixed-case accounts render an identicon オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
似ている issue
-
bug github_actions
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
registrystack/registry-stack#1393 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
JakeChampion/lang#10213 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
oasisprotocol/oasis-sdk#2523 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100