Skip to content

Commit b351ec8

Browse files
authored
PAPI-3321: Add information about cursor pagination support by metafield endpoints (#1235)
1 parent a5213ff commit b351ec8

11 files changed

Lines changed: 1239 additions & 405 deletions

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

reference/carts.v3.yml

Lines changed: 116 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -866,6 +866,8 @@ paths:
866866
- $ref: '#/components/parameters/MetafieldKeyParam'
867867
- $ref: '#/components/parameters/MetafieldNamespaceParam'
868868
- $ref: '#/components/parameters/DirectionParam'
869+
- $ref: '#/components/parameters/BeforeCursorParam'
870+
- $ref: '#/components/parameters/AfterCursorParam'
869871
responses:
870872
'200':
871873
description: |
@@ -1109,6 +1111,8 @@ paths:
11091111
- $ref: '#/components/parameters/date_modified_max'
11101112
- $ref: '#/components/parameters/date_created_min'
11111113
- $ref: '#/components/parameters/date_created_max'
1114+
- $ref: '#/components/parameters/BeforeCursorParam'
1115+
- $ref: '#/components/parameters/AfterCursorParam'
11121116
post:
11131117
summary: Create multiple Metafields
11141118
tags:
@@ -1290,6 +1294,101 @@ paths:
12901294
$ref: '#/components/schemas/MetaFieldCollectionResponsePartialSuccess_DELETE'
12911295
components:
12921296
schemas:
1297+
Pagination:
1298+
type: object
1299+
description: Data about the response, including pagination and collection totals.
1300+
title: Pagination
1301+
properties:
1302+
total:
1303+
type: integer
1304+
description: |
1305+
Total number of items in the result set.
1306+
example: 36
1307+
count:
1308+
type: integer
1309+
description: |
1310+
Total number of items in the collection response.
1311+
example: 36
1312+
per_page:
1313+
type: integer
1314+
description: |
1315+
The amount of items returned in the collection per page, controlled by the limit parameter.
1316+
example: 50
1317+
current_page:
1318+
type: integer
1319+
description: |
1320+
The page you are currently on within the collection.
1321+
example: 1
1322+
total_pages:
1323+
type: integer
1324+
description: |
1325+
The total number of pages in the collection.
1326+
example: 1
1327+
links:
1328+
type: object
1329+
description: |
1330+
Pagination links for the previous and next parts of the whole collection.
1331+
properties:
1332+
previous:
1333+
type: string
1334+
description: |
1335+
Link to the previous page returned in the response.
1336+
current:
1337+
type: string
1338+
description: |
1339+
Link to the current page returned in the response.
1340+
example: '?page=1&limit=50'
1341+
next:
1342+
type: string
1343+
description: |
1344+
Link to the next page returned in the response.
1345+
x-internal: false
1346+
CursorPagination:
1347+
type: object
1348+
description: Data about the response, including cursor pagination and collection totals.
1349+
title: CursorPagination
1350+
properties:
1351+
count:
1352+
type: integer
1353+
description: |
1354+
Total number of items in the collection response.
1355+
example: 36
1356+
per_page:
1357+
type: integer
1358+
description: |
1359+
The amount of items returned in the collection per page, controlled by the limit parameter.
1360+
example: 50
1361+
start_cursor:
1362+
type: string
1363+
description: |
1364+
Cursor that is referring to a start of current page.
1365+
example: "aWQ6Nw=="
1366+
end_cursor:
1367+
type: string
1368+
description: |
1369+
Cursor that is referring to a end of current page. Should be used to fetch next page.
1370+
example: "aWQ6Nw=="
1371+
links:
1372+
type: object
1373+
description: |
1374+
Pagination links for the previous and next parts of the whole collection.
1375+
properties:
1376+
previous:
1377+
type: string
1378+
description: |
1379+
Cursor to the previous page returned in the response.
1380+
example: '?page=1&after=aWQ6Nw%3D%3D'
1381+
current:
1382+
type: string
1383+
description: |
1384+
Cursor to the current page returned in the response.
1385+
example: '?page=1&after=aWQ6Nw%3D%3D'
1386+
next:
1387+
type: string
1388+
description: |
1389+
Cursor to the next page returned in the response.
1390+
example: '?page=1&after=aWQ6Nw%3D%3D'
1391+
x-internal: false
12931392
CartUpdateRequest:
12941393
type: object
12951394
properties:
@@ -3667,53 +3766,9 @@ components:
36673766
description: Data about the response, including pagination and collection totals.
36683767
properties:
36693768
pagination:
3670-
type: object
3671-
description: Data about the response, including pagination and collection totals.
3672-
title: Pagination
3673-
properties:
3674-
total:
3675-
type: integer
3676-
description: |
3677-
Total number of items in the result set.
3678-
example: 36
3679-
count:
3680-
type: integer
3681-
description: |
3682-
Total number of items in the collection response.
3683-
example: 36
3684-
per_page:
3685-
type: integer
3686-
description: |
3687-
The amount of items returned in the collection per page, controlled by the limit parameter.
3688-
example: 50
3689-
current_page:
3690-
type: integer
3691-
description: |
3692-
The page you are currently on within the collection.
3693-
example: 1
3694-
total_pages:
3695-
type: integer
3696-
description: |
3697-
The total number of pages in the collection.
3698-
example: 1
3699-
links:
3700-
type: object
3701-
description: |
3702-
Pagination links for the previous and next parts of the whole collection.
3703-
properties:
3704-
previous:
3705-
type: string
3706-
description: |
3707-
Link to the previous page returned in the response.
3708-
current:
3709-
type: string
3710-
description: |
3711-
Link to the current page returned in the response.
3712-
example: '?page=1&limit=50'
3713-
next:
3714-
type: string
3715-
description: |
3716-
Link to the next page returned in the response.
3769+
$ref: '#/components/schemas/Pagination'
3770+
cursor_pagination:
3771+
$ref: '#/components/schemas/CursorPagination'
37173772
additionalProperties: true
37183773
title: Collection Meta
37193774
x-internal: false
@@ -3779,6 +3834,20 @@ components:
37793834
meta:
37803835
$ref: '#/components/schemas/metaCollection_open'
37813836
parameters:
3837+
BeforeCursorParam:
3838+
name: 'before'
3839+
description: 'A cursor indicating where to start retrieving the previous page of results. Use this parameter to paginate backward. Not required for the initial request. For subsequent requests, use the end_cursor value returned in meta.cursor_pagination from the previous response. Works with limit, direction, and other supported query parameters. When specified, offset-based pagination (page) is ignored. Cannot be used in combination with the after parameter.'
3840+
in: query
3841+
required: false
3842+
schema:
3843+
type: string
3844+
AfterCursorParam:
3845+
name: 'after'
3846+
description: 'A cursor indicating where to start retrieving the next page of results. Use this parameter to paginate forward. Not required for the initial request. For subsequent requests, use the start_cursor value returned in meta.cursor_pagination from the previous response. Works with limit, direction, and other supported query parameters. When specified, offset-based pagination (page) is ignored. Cannot be used in combination with the before parameter.'
3847+
in: query
3848+
required: false
3849+
schema:
3850+
type: string
37823851
Accept:
37833852
name: Accept
37843853
in: header

0 commit comments

Comments
 (0)