Is your feature request related to a problem? Please describe.
I have many function scope struct define in my handler function, and lots of then were nested struct, looks like this:
func ListMyGoods(app *app.Application) gin.HandlerFunc {
type Good struct {
ID int `json:"id"`
Name string `json:"name"`
OwnerID int `json:"owner_id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type Response struct {
Goods []Good `json:"goods"`
}
return func(c *gin.Context) {
// business logic
}
}
and it seems unable to parse it with tag @Success 200 {object} router.ListMyGoods.Response
I got error when I try to generate swagger json
cannot find type definition: Good
I notice there is a solution for a similar problem recently #1274.
Describe the solution you'd like
Can we make it also support nested struct?
Is your feature request related to a problem? Please describe. I have many function scope struct define in my handler function, and lots of then were nested struct, looks like this:
and it seems unable to parse it with tag
@Success 200 {object} router.ListMyGoods.Response
I got error when I try to generate swagger jsonI notice there is a solution for a similar problem recently #1274.
Describe the solution you'd like Can we make it also support nested struct?