title: How to upload both file and JSON data using FastAPI?
body: <p>This is my Pydantic model:</p>
  <pre><code>class Base(BaseModel):
      name: str
      point: Optional[float] = None
      is_accepted: Optional[bool] = False
      
  </code></pre>
  <p>This is the endpoint:</p>
  <pre><code>def create_base(
      base: Base = Form(...),
      file: List[UploadFile] = File(...)
  ):
  ...
  </code></pre>
  <p>I'm trying to send a request via multipart form, but i'm getting the error:</p>
  <pre><code>{
      &quot;detail&quot;: [
          {
              &quot;loc&quot;: [
                  &quot;body&quot;,
                  &quot;base&quot;
              ],
              &quot;msg&quot;: &quot;value is not a valid dict&quot;,
              &quot;type&quot;: &quot;type_error.dict&quot;
          }
      ]
  } 
  </code></pre>
  <p>This is the payload of my request:</p>
  <pre><code>{
    &quot;name&quot;: &quot;string&quot;,
    &quot;point&quot;: 10.0,
    &quot;is_accepted&quot;: true
  }
  </code></pre>
  <p>What am I doing wrong?</p>