anchor.diff:      }
     },
     "links": {
  -    "self": "http://localhost:8080/book/3",
  -    "related": {
  -      "href": "http://localhost:8080/author/9"
  -    }
  +    "self": "http://localhost:8080/book/3"
     }
   }
   
  
positive.code:     },
      "relationships": {
        "author": {
          "data": {
            "type": "author",
            "id": "9"
  
negative.code: 
  ==== Links
  
  In general, links for relationships will be provided when the relationship has a value.
  
  Example output for a has one relationship where the value is null:
  
  [source,json]
  "captain": {
    "data": null
  }
  
  And when the value is not null:
  
  [source,json]
  "author": {
    "links": {
      "self": "/author/9"
    },
    "data": {
      "type": "author",
      "id": "9"
    }
  }
  
  In the case of to many relationships, the JSON API specification only allows a single links object for the collection. Due to no enforced standard for how to link to those nested resources, a link will not be included in the response.
  
  ==== Pagination
  
  The JSON API specification has a section which explains http://jsonapi.org/format/#fetching-pagination[pagination]. The Grails implementation follows that specification as it is written.
  
  To enable pagination links in your output you must be rendering a collection and also include some arguments in addition to the collection being rendered. There are two required arguments: total and resource. The default offset is 0 and max is 10.
  
  [source,groovy]
  model {
      List<Book> books
      Integer bookTotal
  }
  json jsonapi.render(books, [pagination: [total: bookTotal, resource: Book]])
  
  Example links output if `bookTotal == 20`:
  
  [source,json]
  links": {
    "self": "/books",
    "first": "http://localhost:8080/books?offset=0&max=10",
    "next": "http://localhost:8080/player?offset=10&max=10",
    "last": "http://localhost:8080/player?offset=10&max=10"
  }
  
  By default the values for `offset`, `sort`, `max`, and `order` will come from the parameters with the same names. You can override their values by passing the corresponding argument in the pagination Map.
  
  [source,groovy]
  model {
      List<Book> books
      Integer bookTotal
  }
  json jsonapi.render(books, [pagination: [total: bookTotal, resource: Book, max: 20, sort: params.myCustomSortArgument]])
  
  ==== Associations
  
  