Skip to content

Commit

Permalink
doc(gin-swagger): update docments.
Browse files Browse the repository at this point in the history
  • Loading branch information
easonlin404 committed Aug 4, 2017
1 parent 9f415fe commit a10887d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ gin middleware to automatically generate RESTful API documentation with Swagger
1. Add comments to your API source code, [See Declarative Comments Format](https://github.com/swaggo/swag#declarative-comments-format).
2. Download [Swag](https://github.com/swaggo/swag) for Go by using:
```sh
$ go get -u github.com/swaggo/swag
$ go get github.com/swaggo/swag/cmd/swag
```

3. Run the [Swag](https://github.com/swaggo/swag) in your Go project root folder which contains `main.go` file, [Swag](https://github.com/swaggo/swag) will parse comments and generate required files(`docs` folder and `docs/doc.go`).
Expand Down Expand Up @@ -57,7 +57,8 @@ import (
// @BasePath /v2
func main() {
r := gin.New()


// use ginSwagger middleware to
r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))

r.Run()
Expand Down
2 changes: 1 addition & 1 deletion swagger.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/swaggo/swag"
)

// WrapHandler wraps `http.Handler` into `echo.HandlerFunc`.
// WrapHandler wraps `http.Handler` into `gin.HandlerFunc`.
func WrapHandler(h *webdav.Handler) gin.HandlerFunc {
//create a template with name
t := template.New("swagger_index.html")
Expand Down

0 comments on commit a10887d

Please sign in to comment.