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
undefined: "github.com/swaggo/swag".Spec #1126
Comments
same for me here, it's been a while since I last used it. maybe it's something with v1.7.9? |
Yes, I switched back 1.7.8 and it worked. |
Please fill in the report on which swagger handler are u using and which version. We will investigate and will come back with a solution ASAP. |
@mehulgohil Thanks for letting us know, but you are not helping with so less details. ~ go get -u github.com/swaggo/swag/cmd/swag
go: downloading golang.org/x/tools v0.1.9
go: downloading github.com/urfave/cli v1.22.5
go: downloading github.com/go-openapi/swag v0.21.1
go: downloading github.com/cpuguy83/go-md2man/v2 v2.0.1
go: downloading github.com/cpuguy83/go-md2man v1.0.10
go: downloading github.com/russross/blackfriday/v2 v2.1.0
go: downloading github.com/mailru/easyjson v0.7.7
go: downloading golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd
go: downloading github.com/russross/blackfriday v1.6.0
go: downloading golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27
go get: installing executables with 'go get' in module mode is deprecated.
Use 'go install pkg@version' instead.
For more information, see https://golang.org/doc/go-get-install-deprecation
or run 'go help get' or 'go help install'.
~ swag -v
swag version v1.7.9
~ go version
go version go1.17.5 darwin/amd64 |
I had the same issue I was installing swag and generating docs in docker with a go.mod not necessarily matching latest In docker file i have:
Upgrading lib in go.mod seems to resolve the issue :
Error in CI was :
|
Having the same issue as described above using swagger-http handler:
Had a similar usage like AxelDum described, but upgrading the
|
|
Does make any difference if you remove the docs.go from the generated documentation before running The expected behavior should be
|
@AxelDum I can reproduce the issue. We will release an update for the http-swagger package asap. |
Using
I see, that in your example you're not using the latest swag version in your go mod: https://github.com/ubogdan/http-swagger-example/blob/master/go.mod#L18 In this case, I also get your expected behavior. |
Please see the fixed branch. What version of go are u using ? For go > 1.16 the correct install command is |
Ah well sorry, was probably my fault. I oversaw, that v1.7.9 introduced the instance Name (#1116 ) . I was using the config as described in the README ( You mentioned in his Issue :
Did I overlook something or is this a breaking change by mistake? |
@daniel-vera-g Yes, it was by mistake. The issue was caused by the need of having 2 generated documents in the same docs package. Keeping original SwaggerInfo is not possible because when it's used with the new feature the code will not compile at all complaining Please open a separate issue regarding |
swag init with v1.7.9 causes undefined: docs.SwaggerInfo. The v1.7.8 version works. |
@ubogdan Thank you for your devotion to this project. 😊 I think there exist 2 problems for now. Problem 1:
This is because:
That is, Problem 2: Even if I manually install
So I recommend these:
I hope this recommendation actually works! 😊 |
@jihoon-seo The appreciation I get from guys like you motivates me to go forward. ❤️ The change made in 1.7.9-p1 only affects swag, not packages depending on it. The I will look at the provided examples and figure out a way to solve this. regarding
I guess Please let me know if this helps. |
@ubogdan Thanks for the excellent swaggo project! I just want to report that I had the same problem as @jihoon-seo , but following your instructions solved it:
|
I have ParseComment error in file problem I have go-go1.17.1 version above did not help me |
@Abdurashidjon Please open a separate issue and describe the issue you are experiencing in detail. |
@ubogdan I have a ParseComment problem when I run a swag |
This issue is related to undefined: "github.com/swaggo/swag".Spec. |
@ubogdan |
You need to update your swag HTTP handler to the latest version. If you use echo-swagger then the following command should be enough.
|
@ubogdan |
@Abdurashidjon I'm sorry but I can't help you with 0 details. Please open an issue using the tempalte. |
2022/04/16 13:44:36 ParseComment error in file /home/abdurashid/go/src/....../action.go :cannot find type definition: modul.CreateResponse @ubogdan is giving such an error and I did make swag_init. But it repeats such a mistake |
I told you to open a separate issue. Stop mentioning me. |
hi, i have been using this repo for a while now. just a few hours ago, it suddenly threw out the error below:
docs/docs.go:11152:28: undefined: "github.com/swaggo/swag".Spec
may i know how to get rid of this error? thank you.
The text was updated successfully, but these errors were encountered: