title: Using OpenAPI to Receive Files in Multipart Messages
body: <p>I have an API I'm running on Flask/Connexion.  The API is written in OpenAPI 3 for Swagger.  I send data via multipart/form-data to the endpoint, and everything gets through <em>except</em> the uploaded file.  I'll start by sharing my OpenAPI YAML file.  For the file I referenced <a href="https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#considerations-for-file-uploads" rel="nofollow noreferrer">this document</a> on how to specify the schema.</p>
  
  <pre><code>openapi: "3.0.0"
  
  info:
    description: No one is reading this
    version: "1.0.0"
    title: Super basic API endpoint
  
  # Paths supported by the server application
  paths:
     /api/submit:
      post:
        summary: Process a new text submission asynchronously
        operationId: submit.submit
        requestBody:
          content:
            multipart/form-data:
              schema:
                x-body-name: submission
                $ref: '#/components/schemas/Submission'
        responses:
          '200':
            description: That's nice
  
  components:
    schemas:
      Submission:
        type: object
        required:
          - url
          - mimeType
          - language
          - content
        properties:
          url:
            type: string
            format: uri
          mimeType:
            type: string
            description: MIME type of the file submission
          language:
            type: string
            pattern: '^[a-z]{3}$'
          content:
            type: array
            items:
              type: string
              format: binary
  </code></pre>
  
  <p>The <strong>submit.submit</strong> operation calls the following Python code:</p>
  
  <pre><code>from datetime import datetime
  import uuid
  
  def get_timestamp():
      return datetime.now().strftime(("%Y-%m-%d %H:%M:%S"))
  
  def submit(submission):
      print(str(submission))
  
      return { "timestamp": get_timestamp(), "uuid": str(uuid.uuid4()) }
  </code></pre>
  
  <p>What the Python prints is:</p>
  
  <pre><code>{'url': 'http://nosite.none', 'mimeType': 'text/plain', 'language': 'eng'}
  </code></pre>
  
  <p>So no 'content' is present.  But I know the data is being sent since I captured it outbound in my browser:</p>
  
  <pre><code>-----------------------------138508216052
  Content-Disposition: form-data; name="url"
  
  http://nosite.none
  -----------------------------138508216052
  Content-Disposition: form-data; name="mimeType"
  
  text/plain
  -----------------------------138508216052
  Content-Disposition: form-data; name="language"
  
  eng
  -----------------------------138508216052
  Content-Disposition: form-data; name="content"; filename="nonsense.txt"
  Content-Type: text/plain
  
  Now is the time for
  all good men to come
  to the aid of their
  party.
  -----------------------------138508216052--
  </code></pre>
  
  <p>Is there additional debugging I should do with Connexion that will tell me if/why it isn't passing the 'content' file?</p>