<h3 dir="auto">First Check</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I added a very descriptive title to this issue.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I used the GitHub search to find a similar issue and didn't find it.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I searched the FastAPI documentation, with the integrated search.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I already searched in Google "How to X in FastAPI" and didn't find any information.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I already read and followed all the tutorial in the docs and didn't find an answer.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I already checked if it is not related to FastAPI but to <a href="https://github.com/samuelcolvin/pydantic">Pydantic</a>.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I already checked if it is not related to FastAPI but to <a href="https://github.com/swagger-api/swagger-ui">Swagger UI</a>.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I already checked if it is not related to FastAPI but to <a href="https://github.com/Redocly/redoc">ReDoc</a>.</li>
</ul>
<h3 dir="auto">Commit to Help</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I commit to help with one of those options <g-emoji class="g-emoji" alias="point_up_2" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f446.png">👆</g-emoji></li>
</ul>
<h3 dir="auto">Example Code</h3>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="from typing import List, Dict, Tuple

from fastapi import FastAPI
from pydantic import BaseModel

app = FastAPI()

class Answers(BaseModel):
    answers: Dict[str, List[Tuple[str, float]]] = {}

@app.get(&quot;/qa&quot;, response_model=Answers)
async def qatask(request: str):
    return Answers()

if __name__ == &quot;__main__&quot;:
    import uvicorn
    uvicorn.run(&quot;bugfind:app&quot;, host=&quot;0.0.0.0&quot;, port=5000, reload=True,
                workers=1)  # , debug=True)"><pre class="notranslate"><span class="pl-k">from</span> <span class="pl-s1">typing</span> <span class="pl-k">import</span> <span class="pl-v">List</span>, <span class="pl-v">Dict</span>, <span class="pl-v">Tuple</span>

<span class="pl-k">from</span> <span class="pl-s1">fastapi</span> <span class="pl-k">import</span> <span class="pl-v">FastAPI</span>
<span class="pl-k">from</span> <span class="pl-s1">pydantic</span> <span class="pl-k">import</span> <span class="pl-v">BaseModel</span>

<span class="pl-s1">app</span> <span class="pl-c1">=</span> <span class="pl-v">FastAPI</span>()

<span class="pl-k">class</span> <span class="pl-v">Answers</span>(<span class="pl-v">BaseModel</span>):
    <span class="pl-s1">answers</span>: <span class="pl-v">Dict</span>[<span class="pl-s1">str</span>, <span class="pl-v">List</span>[<span class="pl-v">Tuple</span>[<span class="pl-s1">str</span>, <span class="pl-s1">float</span>]]] <span class="pl-c1">=</span> {}

<span class="pl-en">@<span class="pl-s1">app</span>.<span class="pl-en">get</span>(<span class="pl-s">"/qa"</span>, <span class="pl-s1">response_model</span><span class="pl-c1">=</span><span class="pl-v">Answers</span>)</span>
<span class="pl-k">async</span> <span class="pl-k">def</span> <span class="pl-en">qatask</span>(<span class="pl-s1">request</span>: <span class="pl-s1">str</span>):
    <span class="pl-k">return</span> <span class="pl-v">Answers</span>()

<span class="pl-k">if</span> <span class="pl-s1">__name__</span> <span class="pl-c1">==</span> <span class="pl-s">"__main__"</span>:
    <span class="pl-k">import</span> <span class="pl-s1">uvicorn</span>
    <span class="pl-s1">uvicorn</span>.<span class="pl-en">run</span>(<span class="pl-s">"bugfind:app"</span>, <span class="pl-s1">host</span><span class="pl-c1">=</span><span class="pl-s">"0.0.0.0"</span>, <span class="pl-s1">port</span><span class="pl-c1">=</span><span class="pl-c1">5000</span>, <span class="pl-s1">reload</span><span class="pl-c1">=</span><span class="pl-c1">True</span>,
                <span class="pl-s1">workers</span><span class="pl-c1">=</span><span class="pl-c1">1</span>)  <span class="pl-c"># , debug=True)</span></pre></div>
<h3 dir="auto">Description</h3>
<p dir="auto">open <a href="http://localhost:5000/docs" rel="nofollow">http://localhost:5000/docs</a> or <a href="http://localhost:5000/openapi.json" rel="nofollow">http://localhost:5000/openapi.json</a> and you will see the error in the logs.</p>
<h3 dir="auto">Operating System</h3>
<p dir="auto">Linux</p>
<h3 dir="auto">Operating System Details</h3>
<p dir="auto">ubuntu 20.04</p>
<h3 dir="auto">FastAPI Version</h3>
<p dir="auto">0.68.1</p>
<h3 dir="auto">Python Version</h3>
<p dir="auto">3.8.10</p>
<h3 dir="auto">Additional Context</h3>
<p dir="auto">There was a bug <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="467220323" data-permission-text="Title is private" data-url="https://github.com/tiangolo/fastapi/issues/383" data-hovercard-type="issue" data-hovercard-url="/tiangolo/fastapi/issues/383/hovercard" href="https://github.com/tiangolo/fastapi/issues/383">#383</a> a while ago reporting the same problem but closed. This new issue here is in order to reopen that bug as it still isn't solved or reappeared since then. Fell free to close this new issue and reopen the old bug if that is preferred.</p>
<p dir="auto">this is the error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Traceback (most recent call last):
  File &quot;//home/name/.local/lib/python3.8/site-packages/uvicorn/protocols/http/h11_impl.py&quot;, line 373, in run_asgi
    result = await app(self.scope, self.receive, self.send)
  File &quot;//home/name/.local/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py&quot;, line 75, in __call__
    return await self.app(scope, receive, send)
  File &quot;//home/name/.local/lib/python3.8/site-packages/fastapi/applications.py&quot;, line 208, in __call__
    await super().__call__(scope, receive, send)
  File &quot;//home/name/.local/lib/python3.8/site-packages/starlette/applications.py&quot;, line 112, in __call__
    await self.middleware_stack(scope, receive, send)
  File &quot;//home/name/.local/lib/python3.8/site-packages/starlette/middleware/errors.py&quot;, line 181, in __call__
    raise exc from None
  File &quot;//home/name/.local/lib/python3.8/site-packages/starlette/middleware/errors.py&quot;, line 159, in __call__
    await self.app(scope, receive, _send)
  File &quot;//home/name/.local/lib/python3.8/site-packages/starlette/exceptions.py&quot;, line 82, in __call__
    raise exc from None
  File &quot;//home/name/.local/lib/python3.8/site-packages/starlette/exceptions.py&quot;, line 71, in __call__
    await self.app(scope, receive, sender)
  File &quot;//home/name/.local/lib/python3.8/site-packages/starlette/routing.py&quot;, line 580, in __call__
    await route.handle(scope, receive, send)
  File &quot;//home/name/.local/lib/python3.8/site-packages/starlette/routing.py&quot;, line 241, in handle
    await self.app(scope, receive, send)
  File &quot;//home/name/.local/lib/python3.8/site-packages/starlette/routing.py&quot;, line 52, in app
    response = await func(request)
  File &quot;//home/name/.local/lib/python3.8/site-packages/fastapi/applications.py&quot;, line 161, in openapi
    return JSONResponse(self.openapi())
  File &quot;//home/name/.local/lib/python3.8/site-packages/fastapi/applications.py&quot;, line 136, in openapi
    self.openapi_schema = get_openapi(
  File &quot;//home/name/.local/lib/python3.8/site-packages/fastapi/openapi/utils.py&quot;, line 410, in get_openapi
    return jsonable_encoder(OpenAPI(**output), by_alias=True, exclude_none=True)  # type: ignore
  File &quot;pydantic/main.py&quot;, line 406, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 4 validation errors for OpenAPI
components -&gt; schemas -&gt; Answers -&gt; properties -&gt; answers -&gt; additionalProperties -&gt; items -&gt; items
  value is not a valid dict (type=type_error.dict)
components -&gt; schemas -&gt; Answers -&gt; properties -&gt; answers -&gt; additionalProperties -&gt; $ref
  field required (type=value_error.missing)
components -&gt; schemas -&gt; Answers -&gt; properties -&gt; answers -&gt; additionalProperties
  value could not be parsed to a boolean (type=type_error.bool)
components -&gt; schemas -&gt; Answers -&gt; $ref
  field required (type=value_error.missing)"><pre class="notranslate"><code class="notranslate">Traceback (most recent call last):
  File "//home/name/.local/lib/python3.8/site-packages/uvicorn/protocols/http/h11_impl.py", line 373, in run_asgi
    result = await app(self.scope, self.receive, self.send)
  File "//home/name/.local/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 75, in __call__
    return await self.app(scope, receive, send)
  File "//home/name/.local/lib/python3.8/site-packages/fastapi/applications.py", line 208, in __call__
    await super().__call__(scope, receive, send)
  File "//home/name/.local/lib/python3.8/site-packages/starlette/applications.py", line 112, in __call__
    await self.middleware_stack(scope, receive, send)
  File "//home/name/.local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in __call__
    raise exc from None
  File "//home/name/.local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in __call__
    await self.app(scope, receive, _send)
  File "//home/name/.local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in __call__
    raise exc from None
  File "//home/name/.local/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in __call__
    await self.app(scope, receive, sender)
  File "//home/name/.local/lib/python3.8/site-packages/starlette/routing.py", line 580, in __call__
    await route.handle(scope, receive, send)
  File "//home/name/.local/lib/python3.8/site-packages/starlette/routing.py", line 241, in handle
    await self.app(scope, receive, send)
  File "//home/name/.local/lib/python3.8/site-packages/starlette/routing.py", line 52, in app
    response = await func(request)
  File "//home/name/.local/lib/python3.8/site-packages/fastapi/applications.py", line 161, in openapi
    return JSONResponse(self.openapi())
  File "//home/name/.local/lib/python3.8/site-packages/fastapi/applications.py", line 136, in openapi
    self.openapi_schema = get_openapi(
  File "//home/name/.local/lib/python3.8/site-packages/fastapi/openapi/utils.py", line 410, in get_openapi
    return jsonable_encoder(OpenAPI(**output), by_alias=True, exclude_none=True)  # type: ignore
  File "pydantic/main.py", line 406, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 4 validation errors for OpenAPI
components -&gt; schemas -&gt; Answers -&gt; properties -&gt; answers -&gt; additionalProperties -&gt; items -&gt; items
  value is not a valid dict (type=type_error.dict)
components -&gt; schemas -&gt; Answers -&gt; properties -&gt; answers -&gt; additionalProperties -&gt; $ref
  field required (type=value_error.missing)
components -&gt; schemas -&gt; Answers -&gt; properties -&gt; answers -&gt; additionalProperties
  value could not be parsed to a boolean (type=type_error.bool)
components -&gt; schemas -&gt; Answers -&gt; $ref
  field required (type=value_error.missing)
</code></pre></div>
<h3 dir="auto">First Check</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I added a very descriptive title to this issue.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I used the GitHub search to find a similar issue and didn't find it.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I searched the FastAPI documentation, with the integrated search.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I already searched in Google "How to X in FastAPI" and didn't find any information.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I already read and followed all the tutorial in the docs and didn't find an answer.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I already checked if it is not related to FastAPI but to <a href="https://github.com/samuelcolvin/pydantic">Pydantic</a>.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I already checked if it is not related to FastAPI but to <a href="https://github.com/swagger-api/swagger-ui">Swagger UI</a>.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I already checked if it is not related to FastAPI but to <a href="https://github.com/Redocly/redoc">ReDoc</a>.</li>
</ul>
<h3 dir="auto">Commit to Help</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I commit to help with one of those options <g-emoji class="g-emoji" alias="point_up_2" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f446.png">👆</g-emoji></li>
</ul>
<h3 dir="auto">Example Code</h3>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="# main.py

import uvicorn
from fastapi import FastAPI, Form

app = FastAPI()

@app.post(&quot;/&quot;)
def hello(arg: tuple[int, int] = Form(...)) -&gt; str:
    pass

if __name__ == &quot;__main__&quot;:
    uvicorn.run(&quot;main:app&quot;, port=8080)"><pre class="notranslate"><span class="pl-c"># main.py</span>

<span class="pl-k">import</span> <span class="pl-s1">uvicorn</span>
<span class="pl-k">from</span> <span class="pl-s1">fastapi</span> <span class="pl-k">import</span> <span class="pl-v">FastAPI</span>, <span class="pl-v">Form</span>

<span class="pl-s1">app</span> <span class="pl-c1">=</span> <span class="pl-v">FastAPI</span>()

<span class="pl-en">@<span class="pl-s1">app</span>.<span class="pl-en">post</span>(<span class="pl-s">"/"</span>)</span>
<span class="pl-k">def</span> <span class="pl-en">hello</span>(<span class="pl-s1">arg</span>: <span class="pl-s1">tuple</span>[<span class="pl-s1">int</span>, <span class="pl-s1">int</span>] <span class="pl-c1">=</span> <span class="pl-v">Form</span>(...)) <span class="pl-c1">-&gt;</span> <span class="pl-s1">str</span>:
    <span class="pl-k">pass</span>

<span class="pl-k">if</span> <span class="pl-s1">__name__</span> <span class="pl-c1">==</span> <span class="pl-s">"__main__"</span>:
    <span class="pl-s1">uvicorn</span>.<span class="pl-en">run</span>(<span class="pl-s">"main:app"</span>, <span class="pl-s1">port</span><span class="pl-c1">=</span><span class="pl-c1">8080</span>)</pre></div>
<h3 dir="auto">Description</h3>
<ol dir="auto">
<li>Run <code class="notranslate">pip install uvicorn fastapi==0.68.0</code>.</li>
<li>Run <code class="notranslate">python ./main.py</code></li>
<li>Hit <code class="notranslate">localhost:8080/docs</code>, observe internal server error with below validation errors:</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="pydantic.error_wrappers.ValidationError: 2 validation errors for OpenAPI
components -&gt; schemas -&gt; Body_hello__post -&gt; properties -&gt; arg -&gt; items
  value is not a valid dict (type=type_error.dict)
components -&gt; schemas -&gt; Body_hello__post -&gt; $ref
  field required (type=value_error.missing)"><pre class="notranslate"><code class="notranslate">pydantic.error_wrappers.ValidationError: 2 validation errors for OpenAPI
components -&gt; schemas -&gt; Body_hello__post -&gt; properties -&gt; arg -&gt; items
  value is not a valid dict (type=type_error.dict)
components -&gt; schemas -&gt; Body_hello__post -&gt; $ref
  field required (type=value_error.missing)
</code></pre></div>
<ol start="4" dir="auto">
<li>Run <code class="notranslate">pip install fastapi==0.67.0</code></li>
<li>Hit <code class="notranslate">localhost:8080/docs</code>, observe that endpoint documentation is successfully generated.</li>
</ol>
<h3 dir="auto">Operating System</h3>
<p dir="auto">Linux</p>
<h3 dir="auto">Operating System Details</h3>
<p dir="auto">Ubuntu 20.04</p>
<h3 dir="auto">FastAPI Version</h3>
<p dir="auto">0.68.0 has bug, 0.67.0 does not have bug.</p>
<h3 dir="auto">Python Version</h3>
<p dir="auto">3.9</p>
<h3 dir="auto">Additional Context</h3>
<p dir="auto">Any use of <code class="notranslate">tuple</code> in an input (<code class="notranslate">Form</code>, and <code class="notranslate">BaseModel</code> as JSON) or output (<code class="notranslate">BaseModel</code> as JSON) results in above error.</p>