We are using the swagger editor (
http://editor.swagger.io/#/) for documenting the api created using flask python. In our api documentation, we are facing an issue while uploading the file through swagger.
We are using the following line in my yaml file in swagger for upload
parameters:
- name: file
in: formData
description: "file to upload"
required: false
type: file
consumes:
- multipart/form-data
produces:
- application/json
It doesn't seems to be working. Our flask API is handling the file upload request as follow
file_upload = request.files['file']
It is checking the files object sent in the request. The problem is while sending the request using the swagger, the value of "request.files" is returned empty.
Can someone please share their suggestions on how we can make it work?