Pagination
Paginated list methods expose the language’s iteration surface. In TypeScript,
for await fetches pages as you consume their items:
import { Client } from 'glotto-sdk';
const client = new Client({ token: '<token>' });
for await (const item of client.pets.listPets()) {
console.log(item);
}regenerated + byte-diffed in CI a0f8af4b462c
These are byte-for-byte outputs from the same per-language snippet emitters used by
glotto generate, locked to a paginated petstore fixture by a drift test. Your generated version substitutes the package identity, operation name, parameters, authentication scheme, and pagination shape derived from your spec andglotto.yml.
Glotto supports cursor, cursor-id, page, offset, and link-header pagination. An incomplete declaration stays an ordinary request method: the SDK does not invent the missing navigation fields.
Fetch one page
Each supported paginator also has a manual page operation. It fetches one page and exposes its items, response metadata, HTTP response headers, and whether another page exists. Reading those values sends no requests. Fetch the next page explicitly when your application is ready; the next-page call accepts request overrides.
The generated README shows the names and types for your language and API. The automatic iterator uses this same page-fetch operation, so both approaches share authentication, retries, errors, and pagination rules. A typed full-response accessor can report a decoding error if the server returns malformed metadata; reading it does not make another request.
An absolute next link is the server’s complete navigation URL. The SDK follows it without adding the previous page’s filters again. Explicit query overrides on your next-page call can augment that URL.