swag icon indicating copy to clipboard operation
swag copied to clipboard

Question how to specify []string type in formData.

Open Zrealshadow opened this issue 1 year ago • 1 comments

I have this annotation

// @Param includeSections formData []string true "The ID of selected sections, empty for all sections"

and I execute swag init. It will raise error

2023/07/19 16:39:21 Generate swagger docs....
2023/07/19 16:39:21 Generate general API Info, search dir:./
2023/07/19 16:39:21 ParseComment error in file internal/routers/api/v1/ip_handler.go :string is not supported type for formData

If I move this param into query

// @Param includeSections query []string true "The ID of selected sections, empty for all sections"

It will be ok.

Can I have solution for it ? I want to take it as a formData.

Zrealshadow avatar Jul 19 '23 08:07 Zrealshadow

I can not reproduce it

sdghchj avatar Jul 19 '23 10:07 sdghchj