title: Can Spring controller produce multiple content types combinations using same endpoint?
body: <p>I need to serve multiple file types using same endpoint ( zip,pdf,xml).</p>
  <p>I needed to add error handling to those endpoints so in case of error they should return json  (using controller advice) to indicate problem to user.
  For example:</p>
  <pre><code>@GetMapping(value = &quot;api/books&quot;, produces = {applicaton/zip, application/json}
  public ResponseEntity&lt;byte[]&gt; getZipedBooks(){...}
  @GetMapping(value = &quot;api/books&quot;, produces = {applicaton/pdf, application/json}
  public ResponseEntity&lt;byte[]&gt; getPdfBooks()(...}
  </code></pre>
  <p>Without <code>application/json</code> Spring was able to differentiate between those endpoints and call correct one based on accept header. But when I added json Spring is now throwing exception:
  <code>org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation</code>
  even if it can be deduced from <code>accept: application/json,application/pdf</code> header that getPdfBooks should be called.</p>
  <p>Is there any way to configure spring to work with multiple content types on the same endpoint or I need to make special endpoints for every file type ?</p>