Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Adding instructions to finish the steps in `Getting started` section before `How to use it with Gin`
It is easy for anybody to miss out that section which causes unwanted failures in the Swagger UI
  • Loading branch information
saurabhchatterjee23 authored Nov 7, 2023
1 parent 2b5852a commit 9282ac0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ swag init
```

Make sure to import the generated `docs/docs.go` so that your specific configuration gets `init`'ed. If your General API annotations do not live in `main.go`, you can let swag know with `-g` flag.
```go
import _ "example-module-name/docs"
```
```sh
swag init -g http/api.go
```
Expand Down Expand Up @@ -142,6 +145,7 @@ OPTIONS:
Find the example source code [here](https://github.com/swaggo/swag/tree/master/example/celler).
Finish the steps in [Getting started](#getting-started)
1. After using `swag init` to generate Swagger 2.0 docs, import the following packages:
```go
import "github.com/swaggo/gin-swagger" // gin-swagger middleware
Expand Down

0 comments on commit 9282ac0

Please sign in to comment.