Configure auto-pagination
These pages cover SDK generation configured with generators.yml. New projects use sdk-config.yml, so see the Current version of this page for up-to-date guidance. To move an existing project, follow the SDK Config migration guide, which walks through fern sdk migrate, and review the sdk-config.yml reference.
Fern’s auto-pagination supports offset, cursor, URI, and path-based pagination schemes, providing SDK users with simple iterators to loop through all results instead of managing pagination complexity manually.
Generated SDK behavior
TypeScript
Python
Go
Java
C#
Rust
Once you’ve configured pagination for an endpoint, Fern generates a TypeScript
SDK method that returns a Page<T> where T is the underlying data type. The
Page<T> implements the AsyncIterable interface, allowing your users to
use it in a for await loop.
Setting up auto-pagination
Define your pagination scheme and specify where your results are located:
For full configuration details, see Pagination in OpenAPI.