You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generating docs for a Gin web application work great but today I added a new set of routes and one of them is not being added to the docs. I am not sure how best to diagnose this problem. It feels like the scanner is ignoring the troubled project file /cmd/server/handlers/portfolio/get_portfolio_by_id.go while other sibling files are found without problem e.g get_portfolio.go in the same folder.
Swag version: v1.16.2
Go version: 1.21.5
OS: macOS Sonoma 14.2.1
Reproduce
In a typical Gin web application, I build the docs with this command: swag init --parseDependency --parseDepth 3 -o ./docs -g ./main.go
Details
Looking at the swagger.yaml and no docs are present for one of our new routes. In the same project folder, there are many routes properly generated. Worried that it was some spacing issue. I copied the comments from a working route and edited only the relevant details. No luck. I tried to include Just the title and summary and Id with no luck. It feels like the scanner is skipping this file for some reason.
Route document comments
filepath of the non-working route: /cmd/server/handlers/portfolio/get_portfolio_by_id.go
// Get Portfolio By Id//// @Summary GET Portfolio// @ID getPortfolioByUser// @Tags portfolios// @Description Retrieve user portfolio by id// @Produce json// @Param userId path string true "User who owns the portfolio"// @Param portfolioId path string true "Portfolio Id to be returned"// @Success 200 {object} sdk.Portfolio "Portfolio"// @Failure 400 {object} error "missing argument"// @Failure 403 {object} error "JWT is likely expired"// @Failure 500 {object} error// @Router /user/{userId}/portfolios/{portfolioId} [PUT]funcGetPortfolio(c*gin.Context) {
sUserId:=c.Param("userId")
userId, err:=uuid.Parse(sUserId)
iferr!=nil {
auth_middleware.BadRequestError(c, fmt.Errorf("userid should be a uuid. Error: %w", err))
return
}
// ....
}
The text was updated successfully, but these errors were encountered:
Generating docs for a Gin web application work great but today I added a new set of routes and one of them is not being added to the docs. I am not sure how best to diagnose this problem. It feels like the scanner is ignoring the troubled project file
/cmd/server/handlers/portfolio/get_portfolio_by_id.go
while other sibling files are found without problem e.gget_portfolio.go
in the same folder.Swag version: v1.16.2
Go version: 1.21.5
OS: macOS Sonoma 14.2.1
Reproduce
In a typical Gin web application, I build the docs with this command:
swag init --parseDependency --parseDepth 3 -o ./docs -g ./main.go
Details
Looking at the
swagger.yaml
and no docs are present for one of our new routes. In the same project folder, there are many routes properly generated. Worried that it was some spacing issue. I copied the comments from a working route and edited only the relevant details. No luck. I tried to include Just the title and summary and Id with no luck. It feels like the scanner is skipping this file for some reason.Route document comments
filepath of the non-working route:
/cmd/server/handlers/portfolio/get_portfolio_by_id.go
The text was updated successfully, but these errors were encountered: