Skip to content
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 for function scoped struct in type method #277

Open
win-arturo opened this issue Aug 16, 2023 · 0 comments
Open

support for function scoped struct in type method #277

win-arturo opened this issue Aug 16, 2023 · 0 comments

Comments

@win-arturo
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant