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

Commit 5a29808

Browse files
committed
Update open-api.yml and removes cursor term mentions
1 parent e42bf44 commit 5a29808

File tree

2 files changed

+32
-11
lines changed

2 files changed

+32
-11
lines changed

open-api.yaml

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,14 @@ components:
2929
type: integer
3030
description: Limit given for the query. If limit is not provided as a query parameter, this parameter displays the default limit value.
3131
example: 10
32-
after:
32+
from:
3333
type: integer
34-
description: Represents identifier to fetch the next slice of the results. The first item identifier for the next slice starts at `after+1`.
34+
description: The first task uid returned.
3535
example: 999
36+
next:
37+
type: integer
38+
description: 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.
39+
example: 989
3640
timestamp:
3741
type: string
3842
description: An `RFC 3339` format for date/time/duration.
@@ -699,6 +703,12 @@ components:
699703
schema:
700704
type: number
701705
default: 0
706+
from:
707+
name: from
708+
in: query
709+
description: Fetch the next set of results from the given uid.
710+
schema:
711+
type: number
702712
q:
703713
name: q
704714
in: query
@@ -2892,12 +2902,15 @@ paths:
28922902
$ref: '#/components/schemas/task'
28932903
limit:
28942904
$ref: '#/components/schemas/limit'
2895-
after:
2896-
$ref: '#/components/schemas/after'
2905+
from:
2906+
$ref: '#/components/schemas/from'
2907+
next:
2908+
$ref: '#/components/schemas/next'
28972909
required:
28982910
- results
28992911
- limit
2900-
- after
2912+
- from
2913+
- next
29012914
examples:
29022915
Example:
29032916
value:
@@ -2932,9 +2945,12 @@ paths:
29322945
startedAt: '2021-01-01T09:38:02.000000Z'
29332946
finishedAt: '2021-01-01T09:38:07.000000Z'
29342947
limit: 2
2935-
after: null
2948+
from: 1
2949+
next: null
29362950
operationId: tasks.list
2937-
parameters: []
2951+
parameters:
2952+
- $ref: '#/components/parameters/limit'
2953+
- $ref: '#/components/parameters/from'
29382954
security:
29392955
- apiKey: []
29402956
'/tasks/:taskUid':

text/0060-tasks-api.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -572,15 +572,15 @@ New task types are also added for these operations. `indexCreation`, `indexUpdat
572572

573573
The API endpoints `/tasks` and `indexes/{indexUid}/tasks` are browsable using a keyset based pagination.
574574

575-
##### 9.1 Why a keyset based pagination?
575+
##### 9.1 Why a Seek/Keyset based pagination?
576576

577577
Keyset-based pagination is more appropriate when the data can grow or shrink quickly in terms of magnitude.
578578

579579
###### 9.1.1 Pros
580580

581581
The performance is better than the not-so-good but old pagination with `offset`/`limit`.
582582

583-
Cursor pagination keeps the results consistent between each page as the data evolves. It avoids the [Page Drift effect](https://use-the-index-luke.com/sql/partial-results/fetch-next-page), especially when the data is sorted from the most recent to the oldest.
583+
Seek/Keyset pagination keeps the results consistent between each page as the data evolves. It avoids the [Page Drift effect](https://use-the-index-luke.com/sql/partial-results/fetch-next-page), especially when the data is sorted from the most recent to the oldest.
584584

585585
Moreover, the performance is superior to traditional pagination since the computational complexity remains constant to reach the identifier marking the beginning of the new slice to be returned from a hash table.
586586

@@ -594,7 +594,7 @@ The main drawback of this type of pagination is that it does not navigate within
594594
|-------|------|--------------------------------------|
595595
| limit | integer | Default `20`. |
596596
| from | integer | The first task uid returned |
597-
| next | integer - nullable | Represents the query parameter to send 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. |
597+
| 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. |
598598

599599
##### 9.3 GET query parameters
600600

@@ -663,7 +663,7 @@ This part demonstrates keyset paging in action on `/tasks`, but it should be equ
663663
}
664664
```
665665

666-
**End of cursor pagination**
666+
**End of seek/keyset pagination**
667667

668668
`GET` - `/tasks?from=20`
669669

@@ -702,6 +702,11 @@ This part demonstrates keyset paging in action on `/tasks`, but it should be equ
702702

703703
- If `from` is set with an out of bounds task `uid`, the response returns the tasks that are the nearest to the specified uid, the `next` field is set to the next page. It will be equivalent to call the `/tasks` route without any parameter.
704704

705+
###### 9.5.3 Errors
706+
707+
- 🔴 Sending a value with a different type than `Integer` for `limit` returns a [bad_request](0061-error-format-and-definitions.md#bad_request) error.
708+
- 🔴 Sending a value with a different type than `Integer` for `from` returns a [bad_request](0061-error-format-and-definitions.md#bad_request) error.
709+
705710
## 2. Technical details
706711

707712
### I. Measuring

0 commit comments

Comments
 (0)