? ?
avatar stefanoel
stefanoel
6 Nov 2019

Steps to reproduce the issue

There're multiple issues with pagination links:

  1. invoking an API without params (e.g. /api/index.php/v1/plugins)
  2. invoking an API with params (e.g. /api/index.php/v1/plugins?page[offset]=10&page[limit]=10)
  3. invoking the com_config APIs (i.e. /api/index.php/v1/config/application and /api/index.php/v1/config/com_content)

Expected result

  1. accordingly to https://jsonapi.org/format/#fetching-pagination, 'first' and 'previous' links have to be omitted or nulled
  2. the results show the first page[limit] records starting from page[offset]
  3. 'last' pagination link returns the correct page[offset] value

Moreover, pagination links should use the same encoding convention for square brackets.

Actual result

  1. 'first' and 'previous' links are returned with non-null values
  2. regardless of the params supplied, the first 20 records are always returned
  3. 'last' pagination link returns a negative page[offset] value

Moreover, 'self' link has encoded square brackets, the other links don't.

System information (as much as possible)

Additional comments

com_config API has it's own pagination code in Jsonapiview.php in \api\components\com_config\View\Component\JsonapiView.php and \api\components\com_config\View\Application\JsonapiView.php

Other APIs use \libraries\src\MVC\View\JsonApiView.php

avatar stefanoel stefanoel - open - 6 Nov 2019
avatar joomla-cms-bot joomla-cms-bot - labeled - 6 Nov 2019
avatar stefanoel stefanoel - change - 6 Nov 2019
Title
[4.0] API pagination links
[RFC][4.0] API pagination links
avatar stefanoel stefanoel - edited - 6 Nov 2019
avatar joomla-cms-bot joomla-cms-bot - change - 6 Nov 2019
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 6 Nov 2019
avatar Quy Quy - change - 6 Nov 2019
Status New Closed
Closed_Date 0000-00-00 00:00:00 2019-11-06 15:06:13
Closed_By Quy
avatar Quy Quy - close - 6 Nov 2019
avatar Quy
Quy - comment - 6 Nov 2019

See PR #27005


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27004.

avatar Razzo1987
Razzo1987 - comment - 22 Mar 2020

I have the same problem with Joomla_4.0.0-beta1-dev-Development-Full_Package.zip, package were last built: Sunday, 22 March 2020 02:00:44 UTC

My API callback: https://www.diffchecker.com/rJOVNHUk

Add a Comment

Login with GitHub to post a comment