title: Container class for REST get list method
body: <p>I ran into a situation where I thought is a problem of not following REST convention.  Please consider this, I have an API that allows working with book records via this REST API</p>
  
  <pre><code>    http://localhost:8080/api/books
  </code></pre>
  
  <p>In my mind, when I do a GET to retrieve the list, this is what I expect:</p>
  
  <pre><code>    [{"name":"some book name",
        "price":"5"
       },
       {"name":"second book",
        "price":"100"
       }
      ]
  </code></pre>
  
  <p>The above JSON would allow me to easily de-serialize to object list/array with Gson. </p>
  
  <p>However, for some reason this API was implemented so that it returns:</p>
  
  <pre><code>    {"books": [{"name":"some book name",
                  "price":"5"
                 },
                 {"name":"second book",
                  "price":"100"
                 }
                ]
      }
  </code></pre>
  
  <p>As you can see, I now need to use a container class called "Books" to de-serialize to and then I get the book array from one of Books' methods.</p>
  
  <p>I think it is a bad idea to use a container class which does not provide more value (it's just a list container) but I am not an expert/very experienced in all that's involved in managing REST API for large systems.  Therefore if anyone of you can enlighten me as to whether this is perfectly fine or that this is a sign for trouble (with explanation if possible), that is greatly appreciated.</p>