title: How to define path and formData parameters for the same operation in OpenAPI 2.0?
body: <p>I have an image upload endpoint that looks like <code>/test/{id}/relationships/image</code>. I want to describe this endpoint using OpenAPI 2.0 (Swagger 2.0).</p>
  
  <p>The endpoint has both path and formData parameters. I tried the following:</p>
  
  <pre class="lang-yaml prettyprint-override"><code>swagger: '2.0'
  info:
    title: API
    version: 1.0.0
  host: api.server.de
  schemes:
    - https
  produces:
    - application/json
  paths:
    '/test/{id}/relationships/image':
      post:
        operationId: addImage
        consumes:
          - multipart/form-data
        parameters:
          - in: path
            name: id
            required: true
            schema:
              type: integer
              format: int32
          - in: formData
            name: file
            type: file
            required: true
            description: The file to upload.
          - in: formData
            name: metadata
            type: string
            required: false
            description: Description of file contents.
        responses:
          '202':
            description: Uploaded
  </code></pre>
  
  <p>But Swagger Editor shows errors:</p>
  
  <blockquote>
    <p>Schema error at
    paths['/test/{id}/relationships/image'].post.parameters[0].in should
    be equal to one of the allowed values allowedValues: body, header,
    formData, query Jump to line 17</p>
    
    <p>Schema error at
    paths['/test/{id}/relationships/image'].post.parameters[0] should NOT
    have additional properties additionalProperty: schema, in, name,
    required Jump to line 17</p>
  </blockquote>
  
  <p>What am I doing wrong?</p>