Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions fern/products/sdks/guides/configure-auto-pagination.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -152,17 +152,22 @@ To set up auto pagination for the Fern Definition:
1. Specify the pagination scheme, `offset` or `cursor`
1. Specify where your `results` are located, using dot-access notation.

<Tip title="Offset pagination options">
Include `step` in most offset pagination configurations to ensure the offset increments by the page size. Use `has-next-page` when your API returns a boolean indicator for additional pages.
</Tip>

<CodeBlocks>

```yaml Offset {6}
```yaml Offset {6-8}
service:
endpoints:
listWithOffsetPagination:
pagination: # Add pagination field
offset: $request.page # Specify offset pagination scheme
results: $response.data # Specify result location
step: $request.page_size # Recommended: ensures offset increments correctly
has-next-page: $response.has_more # Optional: path to next page indicator
```

```yaml Cursor {7}
service:
endpoints:
Expand All @@ -172,7 +177,6 @@ service:
next_cursor: $response.page.next.starting_after
results: $response.data # Specify result location
```

</CodeBlocks>
</Accordion>
</AccordionGroup>