Closed dub-squared closed 3 years ago
Looks like I missed having to import the generated docs in the main.go file. Once I added _ "go-swag-demo-api/docs"
to the imports it worked
Looks like I missed having to import the generated docs in the main.go file. Once I added
_ "go-swag-demo-api/docs"
to the imports it worked
thank you, this fixed my error
It took me about 3 hours to figure out that this would also solve my issue. My main.go
is in "project_root_dir/cmd/main.go", so I added this to main file.
_ "project_root_dir/cmd/docs"
Describe the bug I've followed the directions to setup the docs on a Gin based API, but when the I visit the docs page, it shows a
Failed to load API definition error
, with a sub error ofFetch error Internal Server Error doc.json
. The server logs show annot yet registered swag
error.To Reproduce Steps to reproduce the behavior:
make run
Expected behavior The Swagger docs should render successfully
Screenshots
Stacktrace
Swag version 1.6.9
Go version 1.15.2
Desktop: