<p dir="auto">OpenAPI allows describing multiple accepted content-types for a request.<br>
Is it possible via FastAPI means?</p>
<p dir="auto">I'd like to make a password login endpoint accepting both <code class="notranslate">application/json</code> and <code class="notranslate">application/x-www-form-urlencoded</code> using a single handler.</p>
<p dir="auto">It seems that swagger interface cannot send Authorization header.</p>
<p dir="auto">I added <code class="notranslate">test_auth</code> endpoint with required header <code class="notranslate">authorization</code> like that:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="async def check_auth(
        authorization: str = Header(...)
):
    pass

@router.post(&quot;/test_auth&quot;)
async def test_auth(
        auth = Depends(check_auth)
):
    pass"><pre class="notranslate"><code class="notranslate">async def check_auth(
        authorization: str = Header(...)
):
    pass

@router.post("/test_auth")
async def test_auth(
        auth = Depends(check_auth)
):
    pass
</code></pre></div>
<p dir="auto">This works perfectly if I use REST-client with set Authorization header. But, if I use swagger UI it seems that Authorization header always missing. Server responses with status code 422 and:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="  &quot;detail&quot;: [
    {
      &quot;loc&quot;: [
        &quot;header&quot;,
        &quot;authorization&quot;
      ],
      &quot;msg&quot;: &quot;field required&quot;,
      &quot;type&quot;: &quot;value_error.missing&quot;
    }
  ]
}"><pre lang="{" class="notranslate"><code class="notranslate">  "detail": [
    {
      "loc": [
        "header",
        "authorization"
      ],
      "msg": "field required",
      "type": "value_error.missing"
    }
  ]
}
</code></pre></div>
<p dir="auto">Another observation is if I change the header name to something else (not authorization) it works. But my goal is using Authorization...</p>
<p dir="auto"><strong>FastAPI version: 0.49.0</strong></p>