REST views: pagination information and total count result

Created on 30 June 2018, over 6 years ago
Updated 21 February 2024, 10 months ago

Problem/Motivation

Currently Views Rest Export does not add pagination information such as current page, total items, total pages and items per page.

A custom serializer could be easily created, but shouldn't the core serializer include this information?

I'm not sure if this should be a bug or feature request.

Proposed resolution

Include current page, total items, total pages and items per page to Views Rest Export.

For this, provide an option in the core serializer display to add pagination information.

The pagination JSON would be:

{ 
  "rows": [
    {<result row 1>},
    {<result row 2>},
    ...
    {<result row N>},
  ],
  "pager": {
    "current_page": <number>,
    "total_items": <number>,
    "total_pages":<number>,
    "items_per_page": <number>
  }
}

Remaining tasks

Functionality is provided but tests are not ok due to schema errors. See comment 70.

✨ Feature request
Status

Needs work

Version

11.0 πŸ”₯

Component
RESTΒ  β†’

Last updated about 1 month ago

Created by

πŸ‡¦πŸ‡·Argentina sharif.elshobkshy

Live updates comments and jobs are added and updated live.
  • VDC

    Related to the Views in Drupal Core initiative.

  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024