-
Notifications
You must be signed in to change notification settings - Fork 266
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
Swagger comments in Go files are not recursively parsed by Swaggo #274
Comments
Hi, were you able to find any solution |
I̶'̶m̶ ̶a̶l̶s̶o̶ ̶s̶t̶u̶c̶k̶ ̶o̶n̶ ̶t̶h̶i̶s̶.̶ ̶H̶a̶v̶e̶n̶'̶t̶ ̶f̶o̶u̶n̶d̶ ̶a̶ ̶s̶o̶l̶u̶t̶i̶o̶n̶ ̶y̶e̶t̶.̶.̶.̶ ̶I̶ ̶h̶a̶v̶e̶ ̶a̶ ̶s̶m̶a̶l̶l̶ ̶A̶P̶I̶ ̶t̶h̶o̶u̶g̶h̶ ̶s̶o̶ ̶I̶ ̶m̶i̶g̶h̶t̶ ̶j̶u̶s̶t̶ ̶h̶a̶n̶d̶ ̶w̶r̶i̶t̶e̶ ̶m̶y̶ ̶s̶p̶e̶c̶.̶ edit: just solved it. Posted in more detail here... Turns out you can't have a blank line between your annotations and the function declaration. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.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 produces the same result
Files that contain swaggo comments are internal/transport/http/v1/auth.go, internal/transport/http/v1/trip.go, and cmd/app/main.go
Structure
Results
Comments in one of the files other than cmd/app/main.go
swag version
e.g. 1.8.12
go version
e.g. 1.20.2
OS
OSX
The text was updated successfully, but these errors were encountered: