> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt.

## 0.10.1

**`(feat):`** 添加对游标和偏移分页的支持。

### 新功能

* 添加对游标和偏移分页的支持。

例如，考虑以下 `/users` 端点：

```yaml
types:
  User:
    properties:
      name: string

  ListUserResponse:
    properties:
      next: optional<string>
      data: list<User>

service:
  auth: false
  base-path: /users
  endpoints:
    list:
      path: ""
      method: GET
      pagination:
        cursor: $request.starting_after
        next_cursor: $response.next
        results: $response.data
      request:
        name: ListUsersRequest
        query-parameters:
          starting_after: optional<string>
      response: ListUsersResponse
```

生成的 `SyncPagingIterable<User>` 可用于遍历 `User` 对象：

```java
for (User user : client.users.list(...)) {
    System.out.println(user);
}
```

或流式处理：

```java
client.users.list(...).streamItems().map(user -> ...);
```

或静态调用 `nextPage()` 手动执行分页：

```java
SyncPagingIterable<User> pager = client.users.list(...);
// 第一页
System.out.println(pager.getItems());
// 第二页
pager = pager.nextPage();
System.out.println(pager.getItems());
```