I want to upload image file. Swagger 2.0 code for upload
/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
I am testing this through postman were in body I have mentioned "form-data" key: "image" value :"Image file"
I am receiving following error
{
"statusCode": 400,
"error": "Bad Request",
"message": "child \"image\" fails because [\"value\" must be a string]",
"validation": {
"source": "payload",
"keys": [
"image"
]
}
}