-
Notifications
You must be signed in to change notification settings - Fork 25
Configuration
Oops! Not much of this page has been written yet. However, our readme features a short version of this section. If the information is not elaborate enough, don't hesitate to create an issue notifying us about it!
- URL of the JSON-API
Coloquent has to translate its queries to HTTP URL strings, and in this process it has to choose between generating pagination parameters page[offset]=...
and page[limit]=...
(called offset-based pagination), or to generate page[]=...
and page[size]=...
(called page-based pagination). Bdefault, Coloquent translates to offset-based paginaion. This is determined by the static property Model.paginationStrategy
, which can be overriden. I.e., to use page-based pagination, write
class YourModel extends Model
{
static paginationStrategy = PaginationStrategy.PageBased;
}
To explicitly use offset-based pagination, write
class YourModel extends Model
{
static paginationStrategy = PaginationStrategy.OffsetBased;
}
The default offset-based pagination parameter names are page[offset]
for indicating the offset, and page[limit]
for indicating the maximum number of items returned.
The default page-based pagination parameter names are page[number]
for indicating the page number, and page[size]
for indicating the number of items on each page.