Statistics about a paginated editoast response
Provides the pagination settings issued in the request alongside
a few convenience fields useful to navigate the paginated results.
Expected usage
This struct is meant to be used and flattened in the response of a paginated query.
#[derive(Serialize, ToSchema)]
struct MyPaginatedResponse {
#[schema(flatten)]
pagination: PaginationStats,
result: Vec<MyData>,
// any other field that makes sense in a paginated response
}
We named the data field result to cope with the old pagination schema which
enforced this name. For new paginated responses, the field name is up to your imagination :)