<p dir="auto">/docs<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/816448/106409931-b2989b00-647c-11eb-8cde-855bf443d153.png"><img src="https://user-images.githubusercontent.com/816448/106409931-b2989b00-647c-11eb-8cde-855bf443d153.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto"><a href="https://cdn.jsdelivr.net/npm/swagger-ui-dist@3/swagger-ui-bundle.js" rel="nofollow">https://cdn.jsdelivr.net/npm/swagger-ui-dist@3/swagger-ui-bundle.js</a><br>
Error!</p>
<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

from fastapi import FastAPI
from pydantic import BaseModel, Field

app = FastAPI()


class Schema(BaseModel):
    business: List[str] = Field(default_factory=list)


@app.get(&quot;/test&quot;, response_model=Schema)
def test():
    return {}"><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-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-v">Field</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">Schema</span>(<span class="pl-v">BaseModel</span>):
    <span class="pl-s1">business</span>: <span class="pl-v">List</span>[<span class="pl-s1">str</span>] <span class="pl-c1">=</span> <span class="pl-v">Field</span>(<span class="pl-s1">default_factory</span><span class="pl-c1">=</span><span class="pl-s1">list</span>)


<span class="pl-en">@<span class="pl-s1">app</span>.<span class="pl-en">get</span>(<span class="pl-s">"/test"</span>, <span class="pl-s1">response_model</span><span class="pl-c1">=</span><span class="pl-v">Schema</span>)</span>
<span class="pl-k">def</span> <span class="pl-en">test</span>():
    <span class="pl-k">return</span> {}</pre></div>
<h3 dir="auto">Description</h3>
<p dir="auto">expect: {"business": []}</p>
<p dir="auto">actually: {"business": None}</p>
<h3 dir="auto">Operating System</h3>
<p dir="auto">Linux</p>
<h3 dir="auto">Operating System Details</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">FastAPI Version</h3>
<p dir="auto">0.81.0</p>
<h3 dir="auto">Python Version</h3>
<p dir="auto">3.8</p>
<h3 dir="auto">Additional Context</h3>
<p dir="auto"><em>No response</em></p>