我想使用快速框架上传多部分表单数据。我正在为我的 API使用带有 express 的swagger-node。现在,我在 swagger YAML 文件中编写了以下内容以上传文件:
/picture/students:
# binds a127 app logic to a route
x-swagger-router-controller: bus_api
post:
description: Upload a picture
# used as the method name of the controller
operationId: uploadStudentPic
consumes:
- multipart/form-data
parameters:
- in: formData
name: imageFile
type: file
description: The file to upload.
required: true
responses:
"200":
description: OK
schema:
# a pointer to a definition
$ref: "#/definitions/SuccessResponseStr"
Run Code Online (Sandbox Code Playgroud)
但现在我不知道如何使用它上传图片。是否有任何内置工具可以在 swagger 中上传图像?