Closed senayuki closed 2 months ago
I eventually discovered that I did not implicitly import model
pkg in the package, just like this _ "github.com/xxx/model"
This was my mistake, but I still don't understand why I just enabled parseDependency, which resulted in two different behaviors that were unexpected.
And I found that this project also has strange problems when parsing generics. I will get Cannot find type definition: response.PaginatorResponse[string]
, not response.PaginatorResponse
, It seems that generics are treated as a whole.
Describe the bug When using the
swag init -g main.go
command, the struct in the model package can be parsed normally, but once the 'parseDependency' is added, likeswag init --parseDependency -g main.go
,it immediately stops working. The struct located atgithub.com/xxx/internal/model.StructName
, and ginHandler located atinternal
pkg Is itinternal
related to this? But adding parseInternal doesn't solve the problem, on the contrary, it works without adding any parse parameters.To Reproduce Steps to reproduce the behavior:
Expected behavior A clear and concise description of what you expected to happen.
Screenshots If applicable, add screenshots to help explain your problem.
Your swag version e.g. 1.16.3
Your go version e.g. 1.22.5
Desktop (please complete the following information):
Additional context Add any other context about the problem here.