Python Flasger-上传文件

Python Flasger-上传文件,python,flask,swagger,flasgger,Python,Flask,Swagger,Flasgger,我正在从事一个项目,需要通过Flasger UI上传文件。我根据招摇过市的文档修改了配置文件,但似乎不起作用。下面是我的配置。请告诉我错误 """ 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

我正在从事一个项目,需要通过Flasger UI上传文件。我根据招摇过市的文档修改了配置文件,但似乎不起作用。下面是我的配置。请告诉我错误

"""
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
...

明白了。必须添加类型参数以及参数下的“file”值。我尝试使用类型参数,但上传时文件仍在加载。你知道问题是什么吗?