Skip to content

Commit

Permalink
Update README.md (#1698)
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 committed Nov 7, 2023
1 parent bab7aac commit 19b9c00
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 @@ -65,6 +65,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 @@ -143,6 +146,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 19b9c00

Please sign in to comment.