swag
swag copied to clipboard
upload multi file is wrong
upload multi file is wrong
// @Summary 多文件上传
// @Security ApiKeyAuth
// @Description | 参数 | 说明 |备注|
// @Description | :-----: | :----: | :----: |
// @accept x-www-form-urlencoded
// @Tags admin
// @version 1.0
// @Param file formData []file true "文件" collectionFormat(multi)
// @success 200 object utils.JSONResult{} "成功"
// @Router /admin/v1/upload/multi [POST]
2021/01/08 11:34:52 ParseComment error in file app/http/controllers/admins/upload_controller.go :file is not supported array type for formData
If you made a variable var files []file
somewhere this file does your code still compile :) .
Is there a solution to this yet?
I also stumbled upon the same problem. Is there a solution for this?
What's the current status of this feature?
#1332 is merged but []file
does nothing different than file
or I couldn't manage to make it work in my local machine.
Any change to update documentation, I would appreciate if anyone adds an example under /example
dir
We are also wondering what the status of this issue is.
We have APIs for users to upload multiple files, but only a single file can be selected from the swagger web interface.
If there is no solution for this issue, you can at least explain what the problem is and encourage a developer to solve it.
example swagger docs:
// .......................
// @Tags Attachment
// @Accept multipart/form-data
// @Produce json
// @Security BearerAuth
// @Param files formData file true "....."
// @Param is_private query string true "..."
// @Param folder query string true "..."
// @Success 200 {array} models.AWSContent "...."