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
I'm having trouble generating Swagger documentation for my Go project using Swaggo. I'm encountering an error that seems to be due to Swaggo not being able to find a type definition that is located in a different directory.
Here's the error message I'm getting:
Error parsing type definition 'main.Neighbors': hashEquals: cannot find type definition: model.NeighborsNeighborsHashEqual
Error parsing type definition 'main.JsonResponse': neighborsData: Neighbors: hashEquals: cannot find type definition: model.NeighborsNeighborsHashEqual
ParseComment error in file /Users/nathannaveen/go/src/github.com/nathannaveen/guac/cmd/rest/known.go :JsonResponse: neighborsData: Neighbors: hashEquals: cannot
ParseComment error in file /Users/nathannaveen/go/src/github.com/nathannaveen/guac/cmd/rest/known.go :JsonResponse: neighborsData: Neighbors: hashEquals: cannot find type definition: model.NeighborsNeighborsHashEqual
The type model.NeighborsNeighborsHashEqual is defined in another directory (/Users/nathannaveen/go/src/github.com/nathannaveen/guac/pkg/assembler/clients/generated/operations.go), and I'm running swag init from /Users/nathannaveen/go/src/github.com/nathannaveen/guac/cmd/rest.
I've tried the following steps to resolve this issue:
Checked my import statements to ensure the package containing model.NeighborsNeighborsHashEqual is correctly imported.
Checked my GOPATH and GOROOT environment variables.
Ensured my Go project is correctly organized according to Go's project layout conventions.
Ran swag init from the root directory of my Go module.
Used the --parseDependency flag when running swag init.
Used the -d flag when running swag init to specify the directory where swaggo should search for types.
Ensured the package is included in my go.mod file and ran go mod tidy.
Despite these steps, I'm still encountering the error. Any help would be greatly appreciated.
Thank you!
The text was updated successfully, but these errors were encountered:
Hello,
I'm having trouble generating Swagger documentation for my Go project using Swaggo. I'm encountering an error that seems to be due to Swaggo not being able to find a type definition that is located in a different directory.
Here's the error message I'm getting:
The type
model.NeighborsNeighborsHashEqual
is defined in another directory (/Users/nathannaveen/go/src/github.com/nathannaveen/guac/pkg/assembler/clients/generated/operations.go
), and I'm runningswag init
from/Users/nathannaveen/go/src/github.com/nathannaveen/guac/cmd/rest
.I've tried the following steps to resolve this issue:
model.NeighborsNeighborsHashEqual
is correctly imported.GOPATH
andGOROOT
environment variables.swag init
from the root directory of my Go module.--parseDependency
flag when runningswag init
.-d
flag when runningswag init
to specify the directory whereswaggo
should search for types.go.mod
file and rango mod tidy
.Despite these steps, I'm still encountering the error. Any help would be greatly appreciated.
Thank you!
The text was updated successfully, but these errors were encountered: