title: How to produce collections of links within the Links section using Spring HATEOAS
body: <p>I am attempting to produce a JSON output similar to the example below:</p>
  
  <pre><code>{
      "links": {
          "self": { "href": "http://api.com/items" },
          "item": [
              { "href": "http://api.com/items/1" },
              { "href": "http://api.com/items/2" }
          ]
      "data": [
              {"itemName":"a"}, 
              {"itemName":"b"} 
       ] 
  }
  </code></pre>
  
  <p></p>
  
  <p>Notice that <code>item</code> is the collection of linked objects. How would I go about doing that with Spring HATEOAS?</p>
  
  <p>UPDATE:
  Adding the same rel multiple times to my <code>UserResource</code> gives me the following:</p>
  
  <pre><code>"links": [
      {
          "rel": "self",
          "href": "http://localhost:8080/sophia/users/admin"
      },
      {
          "rel": "item",
          "href": "http://localhost:8080/sophia/companies/01393048000170/item/1"
      },
      {
          "rel": "item",
          "href": "http://localhost:8080/sophia/companies/01393048000170/item/2"
      },
      {
          "rel": "item",
          "href": "http://localhost:8080/sophia/companies/01393048000170/item/3"
      }
  ]
  </code></pre>