Uploaded image for project: 'Spring Data Commons'
  1. Spring Data Commons
  2. DATACMNS-563

When true setOneIndexedParameters still behaves as false in the links of the json response

    XMLWordPrintable

    Details

      Description

      When setting this to true, the argument 1 accepted from the HTTP request is indeed considered to be the index of the first page, but the json response still displays links as if the first page is indexed 0. For example, requesting the page 3 gets the page 3 but the links are described ignoring the index start at 1. The prev link should show 2 and the next link should show 4. As it stands now, the next page link has the same index as the current page in the request.

      stephane@stephane-ThinkPad-X60:nitro-project-rest> curl -H "Accept:application/json" --user joethebuncer:mignet "http://localhost:8080/nitro-project-rest/admins/search?searchTerm=irstna&page=3&size=12&sort=email"
      {
        "links" : [ {
          "rel" : "next",
          "href" : "http://localhost:8080/nitro-project-rest/admins/search?searchTerm=irstna&page=3&size=12&sort=email,asc"
        }, {
          "rel" : "prev",
          "href" : "http://localhost:8080/nitro-project-rest/admins/search?searchTerm=irstna&page=1&size=12&sort=email,asc"
        }, {
          "rel" : "self",
          "href" : "http://localhost:8080/nitro-project-rest/admins/search?searchTerm=irstna{&page,size,sort}"
        } ]
      

        Attachments

          Activity

            People

            Assignee:
            olivergierke Oliver Drotbohm
            Reporter:
            stephaneeybert Stephane
            Last updater:
            Stephane
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: