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

Pagination links created by PagedResourcesAssembler should have a canonical URL not a templated one

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.11 M1 (Gosling)
    • Component/s: Core
    • Labels:
      None

      Description

      see https://groups.google.com/forum/#!topic/hal-discuss/oIARnoKInpM

      the self links generated by the pagedresourceassembler are currently template and look like this:

      {
       _links : {
         "self": {
            "href": "http://localhost:8080/promotions{?page,size,sort}",
            "templated": true
          }
       }
      } 
      

      but having the self not be a canonical non-templated url seems pretty strange. Also per the HAL spec http://tools.ietf.org/html/draft-kelly-json-hal-06#section-8.1 refs http://tools.ietf.org/html/rfc5988 which defines self as:

      • Relation Name: self
      • Description: Conveys an identifier for the link's context.
      • Reference: [RFC4287]

      which gets to atom http://tools.ietf.org/html/rfc4287 which has no concept of templated...so i'm thinking self should NOT be templated.

      I Propose the templated stuff be put in the search relationship as discussed in linked group, something like:

      “_links”: {
        “self”: { “href”: “/promotions?page=2” }, 
        “next”: { “href”: “/promotions?page=3” }, 
        “prev”: { “href”: “/promotions?page=1” }, 
        “index”: { “href”: “/promotions” } 
        “search”: { “href”: “/promotions{?page,sort,size}”, “templated”: true } 
      }
      

      Notes:

        Attachments

          Activity

            People

            Assignee:
            olivergierke Oliver Drotbohm
            Reporter:
            drdamour Chris DaMour
            Last updater:
            Oliver Drotbohm
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: