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

Error in the gorilla example for walking the API #20

Open
sofianinho opened this issue Nov 20, 2017 · 0 comments
Open

Error in the gorilla example for walking the API #20

sofianinho opened this issue Nov 20, 2017 · 0 comments

Comments

@sofianinho
Copy link

sofianinho commented Nov 20, 2017

Hello,
Thanks for your project and contributions.

There is a problem with the example you gave in 'swag/examples/gorilla/main.go'. Indeed, the path with variable {id} do not work with gorilla if you api.walk using ColonPath (that's for gin). So the example for gorilla should be:

api.Walk(func(path string, endpoint *swagger.Endpoint) {
		h := endpoint.Handler.(http.HandlerFunc)
		router.Path(path).Methods(endpoint.Method).Handler(h)
})

The full example with this correction is in the pull request I just proposed.

Edit: the PR is #21

Thanks
Sofiane

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