Server side 

Server side pagination is controlled with pagination_enabled setting (enabled by default). When it is enabled every collection GET response contains at most pagination_items_per_page items and the client chooses the page with page query param (name can be changed with page_parameter_name).

To disable pagination for a resource (e.g. small dictionaries which should always be returned in full) set pagination_enabled to false:

use SourceBroker\T3api\Annotation as T3api;

/**
 * @T3api\ApiResource(
 *     collectionOperations={
 *          "get"={
 *              "path"="/news/tags",
 *          },
 *     },
 *     attributes={
 *          "pagination_enabled"=false,
 *     }
 * )
 */
class Tag extends \GeorgRinger\News\Domain\Model\Tag
{
}
Copied!

To change the name of the page param or the number of items on page:

/**
 * @T3api\ApiResource(
 *     ...
 *     attributes={
 *          "pagination_items_per_page"=12,
 *          "page_parameter_name"="p",
 *     }
 * )
 */
Copied!

Now the third page is available under ?p=3.

The page number has to be an integer greater than or equal to 1. Any other value (?page=0, ?page=-1, ?page=abc) results in 400 Bad Request:

{
    "hydra:title": "Invalid pagination parameter",
    "hydra:description": "Parameter `page` has to be an integer greater than or equal to 1",
    "hydra:code": 1791043200
}
Copied!