CursorPagination
Pagination strategy that evaluates an interpolated string to define the next page to fetch.
- type:
object - required:
["type","cursor_value"]
type
- Required: Yes
- type:
string - enum:
["CursorPagination"]
cursor_value
Value of the cursor defining the next page to fetch.
- Required: Yes
- type:
string - Available variables:
config,headers,last_page_size,last_record,page_size,response,stream_interval,stream_partition,stream_slice
Examples:
{{ headers.link.next.cursor }}
{{ last_record['key'] }}
{{ response['nextPage'] }}
page_size
The number of records to include in each pages.
- Required: No
- Available variables:
config
Examples:
100
{{ config['page_size'] }}
-
anyOf:
- type:
integer
- type:
-
anyOf:
- type:
string
- type:
stop_condition
Template string evaluating when to stop paginating. Compare last_page_size against page_size rather than against a hardcoded number: page_size is the page size that was actually requested, so the condition stays correct when page_size_reduction shrinks it. It is only bound when this strategy declares page_size, and a condition that reads it without one is rejected, so add page_size alongside the condition. Testing the page for emptiness with last_page_size == 0 is equally safe and needs no page_size. A stream that enables page_size_reduction is rejected when its stop condition compares last_page_size against anything else, since a full page at a reduced size would then read as a short page.
- Required: No
- type:
string - Available variables:
config,headers,last_page_size,last_record,page_size,response,stream_interval,stream_partition,stream_slice
Examples:
{{ response.data.has_more is false }}
{{ 'next' not in headers['link'] }}
{{ last_page_size < page_size }}
$parameters
- Required: No
- type:
object