Is your feature request related to a problem? Please describe.
Using the gin framework, we have the handlers generally defined in a "service struct". The handlers often define their own input and output structs. The current function scoped struct support does not handle this case.
package bob
type service struct {}
// @Success 200 {object} bob.service.handleARequest.output "object containing the A"
func (s service) handleARequest(ctx gin.context) {
type input struct {}
type output struct {A int}
c.JSON(http.StatusOK, output{A:5}
}
Describe the solution you'd like
Extend the function scoped struct feature to support methods of a type.
Describe alternatives you've considered
Pulling the struct out of the method works but is not the desired solution.
Additional context
If this is desirable, I can probably add it.
Is your feature request related to a problem? Please describe. Using the gin framework, we have the handlers generally defined in a "service struct". The handlers often define their own input and output structs. The current function scoped struct support does not handle this case.
package bob
type service struct {}
// @Success 200 {object} bob.service.handleARequest.output "object containing the A" func (s service) handleARequest(ctx gin.context) { type input struct {} type output struct {A int} c.JSON(http.StatusOK, output{A:5} } Describe the solution you'd like Extend the function scoped struct feature to support methods of a type. Describe alternatives you've considered Pulling the struct out of the method works but is not the desired solution.
Additional context If this is desirable, I can probably add it.