app.Get("/swagger/*", swagger.New(swagger.Config{
URL: "http://localhost/doc.json",
DeepLinking: false,
DocExpansion: "none",
/*OAuth: &swagger.OAuthConfig{
AppName: "OAuth Provider",
ClientId: "21bb4edc-05a7-4afc-86f1-2e151e4ba6e2",
},
// Ability to change OAuth2 redirect uri location
OAuth2RedirectUrl: "http://localhost:8080/swagger/oauth2-redirect.html",*/
}))
// GetCountries godoc
// @Summary Retrieves list of countries
// @Description get string by ID
// @Tags accounts
// @Accept json
// @Produce json
// @Param id path int true "Account ID"
// @Success 200 {object} model.Account
// @Failure 400 {object} httputil.HTTPError
// @Failure 404 {object} httputil.HTTPError
// @Failure 500 {object} httputil.HTTPError
// @Router /accounts/{id} [get]
app.Get("/", apiHandlers.GetCountries)
}
Where i run generation with swag init --dir ./,./routes
main is generated but app.Get('/'.....) is not for some reason.
Not sure if i do something wrong or its a bug.
Thanks
**Your swag version**
e.g. 1.16.3
**Your go version**
e.g. 1.23.0
**Desktop (please complete the following information):**
win 11
Describe the bug I would like to generate swagger info not just for main method, but also for endpoints defined in subfolders.
My structure is
and ./routes/routes.go contains package routes
import ( _ "something/docs" "something/routes/handlers/interfaces"
)
func SetupRoutes(app fiber.App, apiHandlers interfaces.ApiHandlersInterface) { app.Get("/swagger/", swagger.HandlerDefault)
}