Swag: Fetch error Internal Server Error doc.json

Created on 17 Apr 2020  路  1Comment  路  Source: swaggo/swag

Describe the bug
I've followed the procedure to use swag with a gin application. I've also checked the example implementation from the source. But, unfortunately facing the error. I'm attaching 2 screenshots of the problem.

To Reproduce
Steps to reproduce the behavior:

  1. go get -u github.com/swaggo/swag/cmd/swag
  2. Follow the steps to use it with gin application.
  3. After doing swag init, I faced a problem like swag not found on a mac. So I did export PATH=$PATH:$HOME/go/bin which fixed the error and generated required files in ./docs dir.
  4. After running the application, I used http://localhost:8888/swagger/index.html as url and getting this error.

Expected behavior
I wanted to display the API docs.

Screenshots
Screen Shot 2563-04-17 at 18 34 35
Screen Shot 2563-04-17 at 18 38 56

Your swag version
1.6.5

Your go version
1.12.0

Desktop (please complete the following information):

  • OS: MacOS Calatila 10.15.3
  • Browser: [Safari, Chrome]
  • Version: [13.0.5, 80.0.3987.163]

Additional context
I've tried several times to find out the issue but seems not yet registered swag swag is not registered.

Most helpful comment

Have not import docs package?

import  _ "./docs"

>All comments

Have not import docs package?

import  _ "./docs"
Was this page helpful?
0 / 5 - 0 ratings

Related issues

kirillDanshin picture kirillDanshin  路  3Comments

fannheyward picture fannheyward  路  3Comments

chiragg6 picture chiragg6  路  7Comments

dz0ny picture dz0ny  路  5Comments

dmirubtsov picture dmirubtsov  路  7Comments