Skip to content

Commit

Permalink
Update gin example to use most recent release changes
Browse files Browse the repository at this point in the history
The most recent release of `oapi-codegen` (v1.10.0) included changes
that broke the existing examples which were introduced in deepmap#530

This change updates the `gin` example by regening the code-generated files and
updating the router registration to work with the new generated code.
  • Loading branch information
ericvolp12 committed Apr 19, 2022
1 parent db1571c commit 4e6d068
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 29 deletions.
41 changes: 14 additions & 27 deletions examples/petstore-expanded/gin/api/petstore-server.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/petstore-expanded/gin/api/petstore-types.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion examples/petstore-expanded/gin/petstore.go
Expand Up @@ -36,7 +36,9 @@ func NewGinPetServer(petStore *api.PetStore, port int) *http.Server {
r.Use(middleware.OapiRequestValidator(swagger))

// We now register our petStore above as the handler for the interface
r = api.RegisterHandlers(r, petStore)
apiRoutes := api.RegisterHandlers(r, petStore).(*gin.RouterGroup)

r.Use(apiRoutes.Handlers...)

s := &http.Server{
Handler: r,
Expand Down

0 comments on commit 4e6d068

Please sign in to comment.