aboutsummaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
Diffstat (limited to 'routers')
-rw-r--r--routers/api/v1/api.go1
-rw-r--r--routers/api/v1/settings/settings.go18
-rw-r--r--routers/api/v1/swagger/settings.go7
3 files changed, 26 insertions, 0 deletions
diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go
index ab7ef6d6f7..027c6abc97 100644
--- a/routers/api/v1/api.go
+++ b/routers/api/v1/api.go
@@ -521,6 +521,7 @@ func RegisterRoutes(m *macaron.Macaron) {
m.Post("/markdown/raw", misc.MarkdownRaw)
m.Group("/settings", func() {
m.Get("/ui", settings.GetGeneralUISettings)
+ m.Get("/api", settings.GetGeneralAPISettings)
m.Get("/repository", settings.GetGeneralRepoSettings)
})
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
diff --git a/routers/api/v1/swagger/settings.go b/routers/api/v1/swagger/settings.go
index 45266e51df..ad0d891dde 100644
--- a/routers/api/v1/swagger/settings.go
+++ b/routers/api/v1/swagger/settings.go
@@ -19,3 +19,10 @@ type swaggerResponseGeneralUISettings struct {
// in:body
Body api.GeneralUISettings `json:"body"`
}
+
+// GeneralAPISettings
+// swagger:response GeneralAPISettings
+type swaggerResponseGeneralAPISettings struct {
+ // in:body
+ Body api.GeneralAPISettings `json:"body"`
+}