summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/settings
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-09-04 20:10:15 +0200
committerGitHub <noreply@github.com>2020-09-04 14:10:15 -0400
commit2a52aeec496b9b1581917124c1002b46f4304b37 (patch)
treeb55eafaf95878f1bbf54618fe09caeb5f96305f2 /routers/api/v1/settings
parent45c0ec31525853b9cfdbd09dc4f41aaeeacdb44c (diff)
downloadgitea-2a52aeec496b9b1581917124c1002b46f4304b37.tar.gz
gitea-2a52aeec496b9b1581917124c1002b46f4304b37.zip
API: Expose its limitation settings (#12714)
* API: Expose its limitation settings * TESTs Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'routers/api/v1/settings')
-rw-r--r--routers/api/v1/settings/settings.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/routers/api/v1/settings/settings.go b/routers/api/v1/settings/settings.go
index 8403a51d3e..7ec0d74c83 100644
--- a/routers/api/v1/settings/settings.go
+++ b/routers/api/v1/settings/settings.go
@@ -27,6 +27,24 @@ func GetGeneralUISettings(ctx *context.APIContext) {
})
}
+// GetGeneralAPISettings returns instance's global settings for api
+func GetGeneralAPISettings(ctx *context.APIContext) {
+ // swagger:operation GET /settings/api settings getGeneralAPISettings
+ // ---
+ // summary: Get instance's global settings for api
+ // produces:
+ // - application/json
+ // responses:
+ // "200":
+ // "$ref": "#/responses/GeneralAPISettings"
+ ctx.JSON(http.StatusOK, api.GeneralAPISettings{
+ MaxResponseItems: setting.API.MaxResponseItems,
+ DefaultPagingNum: setting.API.DefaultPagingNum,
+ DefaultGitTreesPerPage: setting.API.DefaultGitTreesPerPage,
+ DefaultMaxBlobSize: setting.API.DefaultMaxBlobSize,
+ })
+}
+
// GetGeneralRepoSettings returns instance's global settings for repositories
func GetGeneralRepoSettings(ctx *context.APIContext) {
// swagger:operation GET /settings/repository settings getGeneralRepositorySettings