swaggo / gin-swagger

gin middleware to automatically generate RESTful API documentation with Swagger 2.0.
MIT License
3.66k stars 266 forks source link

Question how to specify []string type in formData. #276

Open Zrealshadow opened 11 months ago

Zrealshadow commented 11 months ago

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.

sdghchj commented 11 months ago

Try the latest swag.