refactor: use default error response for swagger (#40048)

ref: https://github.com/go-gitea/gitea/pull/39942#discussion_r4393487959
This commit is contained in:
wxiaoguang
2026-10-28 17:05:00 +08:00
committed by GitHub
parent 30e5ef4228
commit 5671c5192d
93 changed files with 2600 additions and 6894 deletions

View File

@@ -140,8 +140,8 @@ breaking v1.
### Adding and maintaining API routes
- All possible results (errors, success, and failure messages) must be documented in
the swagger comments on the route.
- Document success responses in the swagger comments on the route. Replace explicit
error responses with a `default` response referencing `#/responses/error`.
- Every JSON request body must be defined as a struct in `modules/structs/` and
registered in [`routers/api/v1/swagger/options.go`](../routers/api/v1/swagger/options.go).
- Every JSON response must be defined as a struct in `modules/structs/` and