summaryrefslogtreecommitdiff
path: root/doc/api/labels.md
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2019-08-06 17:27:46 +0100
committerSean McGivern <sean@gitlab.com>2019-08-08 17:10:41 +0100
commite6dc5168b86d613e3334fa55618e394308bf55bf (patch)
tree6ad67848dfbe81949474e20f5224edf055c273cb /doc/api/labels.md
parent26087322713e2949f2bf207798512374757a484c (diff)
downloadgitlab-ce-e6dc5168b86d613e3334fa55618e394308bf55bf.tar.gz
Remove label issue and MR counts from default API responsesspeed-up-labels-api
These counts significantly increase the load time for these requests. Users can now opt in to receiving the counts by setting `with_counts=true` in requests. This is a breaking change, but hopefully a fairly minor one.
Diffstat (limited to 'doc/api/labels.md')
-rw-r--r--doc/api/labels.md9
1 files changed, 5 insertions, 4 deletions
diff --git a/doc/api/labels.md b/doc/api/labels.md
index 9d10d383bf9..5db0edcf14d 100644
--- a/doc/api/labels.md
+++ b/doc/api/labels.md
@@ -8,12 +8,13 @@ Get all labels for a given project.
GET /projects/:id/labels
```
-| Attribute | Type | Required | Description |
-| --------- | ------- | -------- | --------------------- |
-| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user |
+| Attribute | Type | Required | Description |
+| --------- | ------- | -------- | --------------------- |
+| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user |
+| `with_counts` | boolean | no | Whether or not to include issue and merge request counts. Defaults to `false`. _([Introduced in GitLab 12.2](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/31543))_ |
```bash
-curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/labels
+curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/labels?with_counts=true
```
Example response: