4

我正在开发一个需要通过 flasgger UI 上传文件的项目。我根据 Swagger 文档修改了我的 conf,但似乎没有用。下面是我的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'
"""
4

1 回答 1

5

您缺少“类型:文件”,以下内容对我有用:

...
parameters:
    - name: file
      required: false
      in: formData
      type: file
...
于 2018-10-01T19:10:47.607 回答