Skip to content

Commit

Permalink
chore: fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
bodhisatan committed Jun 3, 2022
1 parent ae312cc commit 0d223c3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Hertz-swagger

hertz middleware to automatically generate RESTful API documentation with Swagger 2.0.
Hertz middleware to automatically generate RESTful API documentation with Swagger 2.0.

## Usage

Expand Down Expand Up @@ -94,7 +94,7 @@ import (
"context"
"github.com/cloudwego/hertz/pkg/app"
"github.com/cloudwego/hertz/pkg/app/server"
hertzSwagger "github.com/hertz-contrib/swagger"
swagger "github.com/hertz-contrib/swagger"
_ "github.com/hertz-contrib/swagger/example/basic/docs"
swaggerFiles "github.com/swaggo/files"
)
Expand Down Expand Up @@ -129,8 +129,8 @@ func main() {

h.GET("/ping", PingHandler)

url := hertzSwagger.URL("http://localhost:8888/swagger/doc.json") // The url pointing to API definition
h.GET("/swagger/*any", hertzSwagger.WrapHandler(swaggerFiles.Handler, url))
url := swagger.URL("http://localhost:8888/swagger/doc.json") // The url pointing to API definition
h.GET("/swagger/*any", swagger.WrapHandler(swaggerFiles.Handler, url))

h.Spin()
}
Expand Down
6 changes: 3 additions & 3 deletions example/basic/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (

"github.com/cloudwego/hertz/pkg/app"
"github.com/cloudwego/hertz/pkg/app/server"
hertzSwagger "github.com/hertz-contrib/swagger"
swagger "github.com/hertz-contrib/swagger"
_ "github.com/hertz-contrib/swagger/example/basic/docs"
swaggerFiles "github.com/swaggo/files"
)
Expand Down Expand Up @@ -68,8 +68,8 @@ func main() {

h.GET("/ping", PingHandler)

url := hertzSwagger.URL("http://localhost:8888/swagger/doc.json") // The url pointing to API definition
h.GET("/swagger/*any", hertzSwagger.WrapHandler(swaggerFiles.Handler, url))
url := swagger.URL("http://localhost:8888/swagger/doc.json") // The url pointing to API definition
h.GET("/swagger/*any", swagger.WrapHandler(swaggerFiles.Handler, url))

h.Spin()
}
2 changes: 1 addition & 1 deletion swagger.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* Modifications are Copyright 2022 CloudWeGo Authors.
*/

package hertzSwagger
package swagger

import (
"bytes"
Expand Down
8 changes: 3 additions & 5 deletions swagger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,19 @@
* Modifications are Copyright 2022 CloudWeGo Authors.
*/

package hertzSwagger
package swagger

import (
"io/ioutil"
"net/http"
"testing"

"github.com/cloudwego/hertz/pkg/common/config"
"github.com/cloudwego/hertz/pkg/common/test/assert"
"github.com/cloudwego/hertz/pkg/common/ut"
"github.com/cloudwego/hertz/pkg/route"

"github.com/swaggo/swag"

"github.com/cloudwego/hertz/pkg/common/test/assert"
swaggerFiles "github.com/swaggo/files"
"github.com/swaggo/swag"
)

type mockedSwag struct{}
Expand Down

0 comments on commit 0d223c3

Please sign in to comment.