title: Spring API Mapping produces with or condition
body: <p>I am trying to version my APIs and the approach I am following is by allowing the <code>Accept</code> header.</p>
  <pre><code>@GetMapping(&quot;/api/version&quot;, produces = [&quot;application/vnd.app.v1+json&quot;])
  fun versionOne(): Map&lt;String, String&gt;{
    return mapOf(&quot;version&quot; to &quot;1&quot;)
  }
  
  @GetMapping(&quot;/api/version&quot;, produces = [&quot;application/vnd.app.v2+json&quot;])
  fun versionTwo(): Map&lt;String, String&gt;{
    return mapOf(&quot;version&quot; to &quot;2&quot;)
  }
  </code></pre>
  <p>Now above works well. If the API consumer doesn't pass any accept header, then automatically version 2 is picked up based on the sequence of the code.</p>
  <p>Now my API is already consumed and a few of them are passing <code>Accept: application/json</code> and here my API fails. It returns an error, is there a way to have an <code>or</code> match? If the <code>Accept</code> header is empty or <code>application/json</code>, return the latest version.</p>