Defect #20479
closedUndocumented pagination support for API
Description
It's not documented the possibility to use the page param instead of the offset param.
The ApplicationController.api_offset_and_limit method automatically calculate the offset if the page param is present
Updated by Go MAEDA 12 days ago
- Status changed from New to Closed
- Resolution set to Fixed
Thank you for pointing this out.
I think your point is valid, so I have updated the Wiki page:
https://www.redmine.org/projects/redmine/wiki/Rest_api/104#Collection-resources-and-pagination
The reason I think this is valid is that the page parameter appears to be an intentionally supported API pagination parameter. It was added in commit r4571, whose commit message says: "Makes API accept offset/limit or page/limit parameters for retrieving collections." The behavior is also covered by WelcomeControllerTest#test_api_offset_and_limit_with_page.
Therefore, the previous revision of Rest_api documentation that mentioned only offset and limit was missing the already-supported page parameter.