Option to return both Page and Offset
I would like to have the page number as well as the offset returned in the response. Currently I can either choose Page or LimitOffsetPage but not both.
Hi @dhait,
Could you please provide examples of what you want to achieve?
For response_model "Page", we get:
"items": [ ... ],
"page": 2,
"size": 3,
"pages": 34,
"total": 100
}
For response_mode "LimitOffsetPage", we get:
{
"items": [ ... ],
"limit": 3,
"offset": 2,
"total": 100
}
I would like to see:
{
"items": [ ... ],
"page": 2,
"size": 3,
"offset": 3
"pages": 34,
"total": 100
}
Meaning, the first item displayed is "n" offset from the beginning.
I know I could figure it out by multiplying "size" by "page" but it seems like an extra unnecessary step.
Also, it would be a more flexible solution if we could supply EITHER "page" or "offset" as a parameter, depending on the need (notice that "limit" and "size" appear to be the same value).