Skip to content

Commit 0c51595

Browse files
authored
Clarify that ENABLE_SWAGGER only influences the API docs, not the routes (#21215)
Previously, the docs seemed to suggest that you can disable the API completely by setting `ENABLE_SWAGGER=false`. This is not the case.
1 parent d0e3c53 commit 0c51595

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

custom/conf/app.example.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2153,15 +2153,15 @@ ROUTER = console
21532153
;[api]
21542154
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
21552155
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2156-
;; Enables Swagger. True or false; default is true.
2156+
;; Enables the API documentation endpoints (/api/swagger, /api/v1/swagger, …). True or false.
21572157
;ENABLE_SWAGGER = true
21582158
;; Max number of items in a page
21592159
;MAX_RESPONSE_ITEMS = 50
21602160
;; Default paging number of api
21612161
;DEFAULT_PAGING_NUM = 30
21622162
;; Default and maximum number of items per page for git trees api
21632163
;DEFAULT_GIT_TREES_PER_PAGE = 1000
2164-
;; Default size of a blob returned by the blobs API (default is 10MiB)
2164+
;; Default max size of a blob returned by the blobs API (default is 10MiB)
21652165
;DEFAULT_MAX_BLOB_SIZE = 10485760
21662166

21672167
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

docs/content/doc/advanced/config-cheat-sheet.en-us.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,11 +1015,11 @@ Default templates for project boards:
10151015

10161016
## API (`api`)
10171017

1018-
- `ENABLE_SWAGGER`: **true**: Enables /api/swagger, /api/v1/swagger etc. endpoints. True or false; default is true.
1018+
- `ENABLE_SWAGGER`: **true**: Enables the API documentation endpoints (`/api/swagger`, `/api/v1/swagger`, …). True or false.
10191019
- `MAX_RESPONSE_ITEMS`: **50**: Max number of items in a page.
10201020
- `DEFAULT_PAGING_NUM`: **30**: Default paging number of API.
10211021
- `DEFAULT_GIT_TREES_PER_PAGE`: **1000**: Default and maximum number of items per page for Git trees API.
1022-
- `DEFAULT_MAX_BLOB_SIZE`: **10485760**: Default max size of a blob that can be return by the blobs API.
1022+
- `DEFAULT_MAX_BLOB_SIZE`: **10485760** (10MiB): Default max size of a blob that can be returned by the blobs API.
10231023

10241024
## OAuth2 (`oauth2`)
10251025

docs/content/doc/advanced/config-cheat-sheet.zh-cn.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ test01.xls: application/vnd.ms-excel; charset=binary
299299

300300
## API (`api`)
301301

302-
- `ENABLE_SWAGGER`: **true**: 是否启用swagger路由 /api/swagger, /api/v1/swagger etc. endpoints. True 或 false; 默认是 true.
302+
- `ENABLE_SWAGGER`: **true**: 是否启用swagger路由 /api/swagger, /api/v1/swagger etc. endpoints. True 或 false.
303303
- `MAX_RESPONSE_ITEMS`: **50**: 一个页面最大的项目数。
304304
- `DEFAULT_PAGING_NUM`: **30**: API中默认分页条数。
305305
- `DEFAULT_GIT_TREES_PER_PAGE`: **1000**: GIT TREES API每页的默认最大项数.

docs/content/doc/help/faq.en-us.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,13 @@ A "login prohibited" user is a user that is not allowed to log in to Gitea anymo
126126

127127
## What is Swagger?
128128

129-
[Swagger](https://swagger.io/) is what Gitea uses for its API.
129+
[Swagger](https://swagger.io/) is what Gitea uses for its API documentation.
130130

131-
All Gitea instances have the built-in API, though it can be disabled by setting `ENABLE_SWAGGER` to `false` in the `api` section of your `app.ini`
131+
All Gitea instances have the built-in API and there is no way to disable it completely.
132+
You can, however, disable showing its documentation by setting `ENABLE_SWAGGER` to `false` in the `api` section of your `app.ini`.
133+
For more information, refer to Gitea's [API docs]({{< relref "doc/developers/api-usage.en-us.md" >}}).
132134

133-
For more information, refer to Gitea's [API docs]({{< relref "doc/developers/api-usage.en-us.md" >}})
134-
135-
[Swagger Example](https://try.gitea.io/api/swagger)
135+
You can see the latest API (for example) on <https://try.gitea.io/api/swagger>.
136136

137137
## Adjusting your server for public/private use
138138

0 commit comments

Comments
 (0)