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
swag init
doesn't parse 'module' dependencies for types, they must be vendored
#1734
Comments
|
Well, doh! Maybe the documentation needs to be updated: swag init --help indicates: Go modules are not a single "dependency folder" AFAIK. Maybe a better explanation would be: |
I've found that I wonder why this isn't the default... |
Oh, it is the default. I may have been confused somehow... |
When a type is declared in a dependency,
swag init
fails with "cannot find type definition: ..."To successfully generate docs, dependencies must be vendored with
go mod vendor
and then useswag init -parseVendor
Is this intended/an unmentioned limitation?
Thanks!!
To Reproduce
~/swagmodtest/main.go
or$GOPATH/example.com/swagmodtest/main.go
[...]/main.go :cannot find type definition: primitive.Binary
Fix with vendoring
swagger.yaml:
Your swag version
Your go version
Desktop:
Additional context
The code builds/runs fine with go modules and no vendoring
The text was updated successfully, but these errors were encountered: