pyopenapi / pyswagger

An OpenAPI (fka Swagger) client & converter in python, which is type-safe, dynamic, spec-compliant.
MIT License
384 stars 88 forks source link

Error raised when using 'file' as parameter type #99

Closed erikpotterbsx closed 7 years ago

erikpotterbsx commented 7 years ago

According to the Swagger 2.0 spec, I should be able to do something like this:

  consumes:
    - multipart/form-data  # and/or application/x-www-form-urlencoded
  parameters:
    - name: file
      in: formData
      description: The uploaded file data
      required: true
      type: file

but in pyswagger 0.8.24 I get an error like this:

- 'parameterObject':
  - 'type':
    - 'type':
      - 'enum':
        - "Invalid value.  file is not one of the available options (['null', 'boolean', 'integer', 'number', 'string', 'array'])"

From the Swagger 2.0 spec:

An additional primitive data type "file" is used by the Parameter Object and the Response Object to set the parameter type or the response as being a file.

and

There are five possible parameter types. ... Form - Used to describe the payload of an HTTP request when either application/x-www-form-urlencoded, multipart/form-data or both are used as the content type of the request (in Swagger's definition, the consumes property of an operation). This is the only parameter type that can be used to send files, thus supporting the file type.

erikpotterbsx commented 7 years ago

Please disregard this issue, it's actually a problem with flex and I meant to leave it on the flex issues tracker. Sorry

mission-liao commented 7 years ago

OK, please feel free to let me know if anything goes wrong.