Pagination

Configure pagination for methods that return lists:

pagination_service.proto
1syntax = "proto3";
2
3package userservice.v1;
4
5service UserService {
6 rpc ListUsers(ListUsersRequest) returns (ListUsersResponse) {
7 option (x_fern_pagination) = '{
8 "cursor": "page_token",
9 "results": "users",
10 "next_cursor": "next_page_token",
11 "has_next_page": "has_more"
12 }';
13 }
14}
15
16message ListUsersRequest {
17 int32 page_size = 1;
18 string page_token = 2;
19 string filter = 3;
20}
21
22message ListUsersResponse {
23 repeated User users = 1;
24 string next_page_token = 2;
25 bool has_more = 3;
26 int32 total_count = 4;
27}