Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Commit

Permalink
Tasks route total (#253)
Browse files Browse the repository at this point in the history
* Update the tasks route info to add the total field

* Update the OpenApi of the tasks route
  • Loading branch information
Kerollmops authored Jul 31, 2023
1 parent 1a3f49d commit 0e79bef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions open-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3909,6 +3909,8 @@ paths:
type: array
items:
$ref: '#/components/schemas/task'
total:
$ref: '#/components/schemas/total'
limit:
$ref: '#/components/schemas/limit'
from:
Expand All @@ -3917,6 +3919,7 @@ paths:
$ref: '#/components/schemas/next'
required:
- results
- total
- limit
- from
- next
Expand Down Expand Up @@ -3959,6 +3962,7 @@ paths:
next: null
operationId: tasks.list
parameters:
- $ref: '#/components/parameters/total'
- $ref: '#/components/parameters/limit'
- $ref: '#/components/parameters/from'
- $ref: '#/components/parameters/taskFilterUids'
Expand Down
4 changes: 4 additions & 0 deletions text/0060-tasks-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,7 @@ The main drawback of this type of pagination is that it does not navigate within

| field | type | description |
|-------|------|--------------------------------------|
| total | integer | The total number of tasks matching the filter/query |
| limit | integer | Default `20`. |
| from | integer | The first task uid returned |
| next | integer - nullable | Represents the value to send in `from` to fetch the next slice of the results. The first item for the next slice starts at this exact number. When the returned value is null, it means that all the data have been browsed in the given order. |
Expand Down Expand Up @@ -602,6 +603,7 @@ This part demonstrates keyset paging in action on `/tasks`. The items `uid` rema
...,
}
],
"total": 1351,
"limit": 20,
"from": 1350,
"next": 1329
Expand Down Expand Up @@ -629,6 +631,7 @@ This part demonstrates keyset paging in action on `/tasks`. The items `uid` rema
...,
}
],
"total": 1330,
"limit": 50,
"from": 1329,
"next": 1278
Expand Down Expand Up @@ -656,6 +659,7 @@ This part demonstrates keyset paging in action on `/tasks`. The items `uid` rema
...,
}
],
"total": 20,
"limit": 20,
"from": 20,
"next": null
Expand Down

0 comments on commit 0e79bef

Please sign in to comment.