title: Optionally disable HATEOAS format in Spring Data Rest
body: <p>So let's say I have an existing application that has two endpoints /people and /pants. Calling GET /people returns:</p>
  <pre><code>[
      {
          &quot;name&quot;:&quot;john&quot;,
          &quot;age&quot;:37,
          &quot;pants&quot;:[
              {
                  &quot;color&quot;:&quot;green&quot;,
                  &quot;brand&quot;:&quot;levis&quot;,
                  &quot;size&quot;:&quot;medium&quot;
              },
              {
                  &quot;color&quot;:&quot;indigo&quot;,
                  &quot;brand&quot;:&quot;jncos&quot;,
                  &quot;size&quot;:&quot;medium-with-huge-legs&quot;
              }
          ]
      },
      {
          &quot;name&quot;:&quot;june&quot;,
          &quot;age&quot;:23,
          &quot;pants&quot;:[
              {
                  &quot;color&quot;:&quot;pink&quot;,
                  &quot;brand&quot;:&quot;gap&quot;,
                  &quot;size&quot;:&quot;small&quot;
              }
          ]
      }
  ]
  </code></pre>
  <p>If i were to use Spring Data Rest and call GET /person i'd receive something like:</p>
  <pre><code>{
      &quot;_links&quot;:{
          &quot;next&quot;:{
              &quot;href&quot;:&quot;http://myapp.com/people?page=1&amp;size=20&quot;
          },
          &quot;self&quot;:{
              &quot;href&quot;:&quot;http://myapp.com/people{&amp;page,size,sort}&quot;,
              &quot;templated&quot;:true
          },
          &quot;search&quot;:{
              &quot;href&quot;:&quot;http://myapp.com/people/search&quot;
          }
      },
      &quot;_embedded&quot;:{
          &quot;people&quot;:[
              {
                  &quot;name&quot;:&quot;john&quot;,
                  &quot;age&quot;:37,
                  &quot;_links&quot;:{
                      &quot;self&quot;:{
                          &quot;href&quot;:&quot;http://myapp.com/people/john&quot;
                      },
                      &quot;pants&quot;:{
                          &quot;href&quot;:&quot;http://myapp.com/people/john/pants&quot;
                      }
                  }
              },
              {
                  &quot;name&quot;:&quot;june&quot;,
                  &quot;age&quot;:23,
                  &quot;_links&quot;:{
                      &quot;self&quot;:{
                          &quot;href&quot;:&quot;http://myapp.com/people/june&quot;
                      },
                      &quot;pants&quot;:{
                          &quot;href&quot;:&quot;http://myapp.com/people/june/pants&quot;
                      }
                  }
              }
          ]
      }
  }
  </code></pre>
  <p>Let's say I have a bunch of existing clients that I don't want to have to change - is there any way to disable the hypermedia portions of the response in some cases (say Accept=&quot;application/json&quot;) but enable it them for others (Accept=&quot;hal+json&quot;)?</p>
  <p>Thanks!</p>
  <p><em><strong>Updated</strong></em></p>
  <p>Okay - so it appears that much to my chagrin, what I'm looking to do is not supported. I understand why Spring Data Rest is strongly leaning toward Hypermedia... but I don't buy that providing the capability to &quot;disable&quot; hypermedia based on a header thus providing more options is a bad thing.</p>
  <p>That aside, I'm a bit unsure of how to actually achieve this via my own Controllers. If I create a Controller and attempt to override the <code>/people</code> RequestMapping with <code>produces = &quot;application/json&quot; I am able to get the &quot;raw&quot; json back with Accept=&quot;application/json&quot; but if I pass </code>Accept=&quot;application/hal+json&quot;` I get a 406 with &quot;Could not find acceptable representation&quot;. It looks like the SDR resource mappings aren't mapped with a content type ... any suggestions?</p>