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
2024/05/06 17:05:49 Generate swagger docs....
2024/05/06 17:05:49 Generate general API Info, search dir:./
2024/05/06 17:05:49 Generating main.Foo
2024/05/06 17:05:49 Error parsing type definition 'main.Foo': field: cannot find type definition: lib.Bar
2024/05/06 17:05:49 ParseComment error in file /Users/chirino/sandbox/swag-bug-example/main/main.go :Foo: field: cannot find type definition: lib.Bar
exit status 1
Your swag version
v1.16.3
Your go version
go1.22.
The text was updated successfully, but these errors were encountered:
chirino
changed the title
Swag fails to load type in external package where package path does not match the package name.
Swag fails to load type in external package.
May 6, 2024
I have the same problem - but it gives me an error saying the external package is missing when it's in both the go.mod and go.sum
running swag init --parseDependency produces:
missing go.sum entry for module providing package github.com/hcpd-solutions/pki; to add:
go mod download github.com/hcpd-solutions/pki
missing go.sum entry for module providing package github.com/hcpd-solutions/pki; to add:
go mod download github.com/hcpd-solutions/pki
Describe the bug
Swag fails to load type in external package.
To Reproduce
I created a super small project to illustrate the error:
Expected behavior
no errors should occur.
Screenshots
Your swag version
v1.16.3
Your go version
go1.22.
The text was updated successfully, but these errors were encountered: