Problem/Motivation

View allows to create pagination but there is no provision to access the same mechanism in REST interface. Consider the following example :

paging.png

Here a REST export is created on path /comments/%nid and it returns JSON list of comments for nid given. Here I pager is enabled then it only show specified number of items, for this example it is 10.

Proposed resolution

  1. The best solution according to REST full standard is that URL for accessing next and previous page i.e 10 JSON objects is given in "_links": filed of response JSON so that application developer can use it and implement efficient paging mechanism.
  2. Or the path for this kind of view should be designed like /comments/%nid/%nextItemNumber so here application developer can specify the number of item from where application is left to download the information i.e on first request it can be like /comments/5/0 then it will return 10 comments ( this number is configured by admin view via PAGER ) then subsequently it can request /comments/5/10 etc. Please give a well documented example for how to create such paths for REST view export.
CommentFileSizeAuthor
paging.png108.66 KBvivekvpandya
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

vivekvpandya created an issue. See original summary.

Wim Leers’s picture

Title: Paging related URLs should be returned in "_links": section of response for view based REST export » REST views: Paging-related URLs should be returned in "_links" section of HAL+JSON response
Category: Support request » Task
Issue tags: +VDC
Wim Leers’s picture

Status: Active » Closed (duplicate)
Related issues: +#2099281: [PP-1] REST views: pagination link relations

This is actually just a duplicate of #2099281: [PP-1] REST views: pagination link relations, which is almost two years older.