Flasgger - 上传文件

Flasgger - Upload File

我正在做一个需要通过 flasgger 上传文件的项目 UI。我根据 Swagger 文档修改了我的 conf,但似乎不起作用。下面是我的会议。请告知错误。

"""
This API let's you train word embeddings
Call this api passing your file and get the word embeddings.

---
tags:
  - Train (Word Embeddings)
consumes:
  - multipart/form-data  
parameters:
  - in: formData
    name: body
    required: true
    description: Upload your file.
responses:
  500:
    description: ERROR Failed!
  200:
    description: INFO Success!
    schema:
      $ref: '#/definitions/txt_embeddings'
"""

您缺少 'type: file',以下对我有用:

...
parameters:
    - name: file
      required: false
      in: formData
      type: file
...