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
Issue Description
Swaggo fails to recursively parse Swagger comments in Go files when using the swag init command with multiple directories and the --parseDependency and --parseInternal flags. Only the comments in the main file specified with the -g flag are parsed, while the comments in other files within the specified directories are not considered. docs directory is included in router(internal/transport/htpp/handler.go) and in cmd/app/main.go
commands I have run:
swag init -d cmd/app/ -g main.go --parseDependency --parseInternal
Result in the swagger.yml
Screenshot 2023-06-27 at 16 24 50
Command Respond
Screenshot 2023-06-27 at 16 15 24
Structure
Screenshot 2023-06-27 at 16 15 50
Files that contain swaggo comments are internal/transport/http/v1/auth.go, internal/transport/http/v1/trip.go, and cmd/app/main.go
Comments in one of the files other than cmd/app/main.go
Screenshot 2023-06-27 at 16 16 10
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Issue Description
Swaggo fails to recursively parse Swagger comments in Go files when using the swag init command with multiple directories and the --parseDependency and --parseInternal flags. Only the comments in the main file specified with the -g flag are parsed, while the comments in other files within the specified directories are not considered. docs directory is included in router(internal/transport/htpp/handler.go) and in cmd/app/main.go
commands I have run:
swag init -d cmd/app/ -g main.go --parseDependency --parseInternal
swag init -d cmd/app/,internal/transport/http/v1 -g main.go --parseDependency --parseInternal
All the commands above produce the same result
Result in the swagger.yml
Screenshot 2023-06-27 at 16 24 50
Command Respond
Screenshot 2023-06-27 at 16 15 24
Structure
Screenshot 2023-06-27 at 16 15 50
Files that contain swaggo comments are internal/transport/http/v1/auth.go, internal/transport/http/v1/trip.go, and cmd/app/main.go
Comments in one of the files other than cmd/app/main.go
Screenshot 2023-06-27 at 16 16 10
Your swag version
e.g. 1.8.12
Your go version
e.g. 1.20.2
OS
OSX
Beta Was this translation helpful? Give feedback.
All reactions