Uploaded image for project: 'Magnolia REST Framework'
  1. Magnolia REST Framework
  2. MGNLREST-197

Lacking of total size of items when doing REST requests

XMLWordPrintable

    • DevX 6, DevX 7
    • 3

      Timebox: 3SP

      User Story: As a developer I want to know the total number of results, so I can inform the user, and in some cases so that my frontend can display an accurate scrollbar or other control type.

      Note: This is not the number of returned results, we need the total number of results in the system that match the query in order to implement comprehensive paging behaviour on the client/frontend.

      As described in SUPPORT-9407 that in info.magnolia.rest.delivery.jcr.NodesResultWriter.writeTo(...)
      We had a TODO item:

      temporary exclude total query metadata as api is not ready to provide estimated query size.

      This prevented customer to have total size of items when doing REST requests.
      Please consider to have a fix for this.

      Suggestion

      (from bstaryga )

      It makes it hard to paginate/lazy load with help of offset and limit, as we do not know how many pages should there be.

      It would be nice to extend the response to have the following properties:

      • limit
      • size
      • start

      e.g.:

      {
        "limit": 5,
        "size": 10,
        "start": 0,
        "results": [...]
      }

       

       

      Input from customer:

      "We are wanting in the Delivery API to have a way to see the total number of results for a given query so we can better manage pagination. When completing a query with an offset and limit, we are able to retrieve a given query in chunks which is helpful, but we also need the number total results so that we can know how many pages of data there are and produce a UI which includes Page numbers, not just next and previous. This seems to be common in API's which offer pagination so we would love to see that here."

        Acceptance criteria

              chuong.doan Chuong Doan Huy
              viet.nguyen Viet Nguyen
              DeveloperX
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - Not Specified
                  Not Specified
                  Logged:
                  Time Spent - 3d 6.5h
                  3d 6.5h