paths:
  get:
    tags:
    - files
    summary: "Fetch a file"
    parameters:
    - $ref: "#/components/parameters/path"
    responses:
      200:
        content:
          text/plain:
            schema:
              type: string

  post:
    tags:
    - files
    summary: "Provide or direct link to a file"
    parameters:
    - $ref: "#/components/parameters/path"
    - $ref: "#/components/parameters/direct"
    requestBody:
      description: "If ?direct=true, then a direct link to the file, else a multi-part form"
      content:
        text/plain:
          schema:
            type: string
            example: "http://imgur.com/img/mine.png"
        application/x-www-form-urlencoded:
          schema:
            type: string
            example: "password=123"
    responses:
      200:
        $ref: "#/components/schemas/ok"

components:
  parameters:
    path:
      $ref: "./swagger.yaml#/components/parameters/path"

    direct:
      name: direct
      in: query
      schema:
        type: bool

  schemas:
    ok:
      $ref: "./swagger.yaml#/components/schemas/ok"
