zfcampus/zf-rest — pull request #49 by Wilt (2014-09-19 07:22:42+00:00)
Title: Max & Min page size feature

The configuration in `zf-rest` features a custom page size set on the client side. Then I think it would also be useful to be able to set a valid range for the page size. If there are a lot of records in the database the client can still overload the server by demanding a huge (undesirable) page size in the request.
The proposed solution is to allow configuration for minimum and maximum page sizes in the controller config like this:
```
'min_page_size' => 5,
'page_size' => 10,
'max_page_size' => 20,
'page_size_param' => 'page_size',
```
So if the client sends a request with `http:api/v1/example.com/collection?page_size=1` or `http:api/v1/example.com/collection?page_size=10000` there will be an ApiProblem response saying that the page size is out of range. Like this we have better control over our server load.

note: Renaming the `page_size` parameter to `default_page_size` could be desirable.