我想上传图片文件。 用于上传的Swagger 2.0代码
/upload:
post:
summary: Uploads a file.
consumes:
- multipart/form-data
produces:
- application/json
parameters:
- name: image
in: formData
required: false
type: file
description: The file to upload.
responses:
'200':
description: OK (successfully uploaded)
'500':
description: Error importing file
我正在测试这个通过邮递员身体我提到“形式数据” key:“image”值:“图像文件”
我收到以下错误
{
"statusCode": 400,
"error": "Bad Request",
"message": "child \"image\" fails because [\"value\" must be a string]",
"validation": {
"source": "payload",
"keys": [
"image"
]
}
}