-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support objects for formData #300
Comments
I see. |
I have the same problem type equipmentQuery struct {
ProductName string `json:"product_name" form:"product_name"` // 产品名称
Sn string `json:"sn" form:"sn"` // sn号
ClientCode string `json:"client_code" form:"client_code"` // 代理商编号可多选用","隔开
Page int `json:"page" form:"page"` //页数
PageSize int `json:"pagesize" form:"pagesize"` // 每页展示条数
File string `json:"file"form:"file" format:"binary" form:"file"`
}
// @Param file formData equipmentQuery true "parameter" I set a structure to use the parameter type of formdata, but when generating a swagger document, it will report equipmentquery is not supported type for formdata Does formdata not support user defined struct yet? |
Any updates? paramType body seems to work - paramType formData not.. |
@danielpoe
|
你好,请问解决了吗 |
Is your feature request related to a problem? Please describe.
Not that i know of.
Describe the solution you'd like
I have not seen a solution to this in the documentation, but the documentation on @param is a bit lacking (i.e. does not mention formData being an option).
When setting @param, it would be nice if you could specify object and object type. This way it's clear what sort of input my endpoint expects. For example, the following go code...
...provides the following swagger:
What I would like is for the swagger to include the type def, and look like this:
Describe alternatives you've considered
An alternative, but ugly, solution is to add a dummy function that contains the struct as an object, such as this one.
I could also use param type 'body', but that is also somewhat ugly (and misleading).
Additional context
N/A
The text was updated successfully, but these errors were encountered: