Skip to content

Commit

Permalink
chore: move Server (net/http) over to using Registers
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanhitt committed Dec 24, 2024
1 parent 7297642 commit 19055e1
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions openapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,16 @@ func (s *Server) registerOpenAPIRoutes(jsonSpec []byte) {
s.printOpenAPIMessage(fmt.Sprintf("JSON spec: %s%s", s.url(), s.OpenAPIConfig.JsonUrl))

if !s.OpenAPIConfig.DisableSwaggerUI {
Register(s, Route[any, any]{
BaseRoute: BaseRoute{
Method: http.MethodGet,
Path: s.OpenAPIConfig.SwaggerUrl + "/",
Registers(s.Engine, netHttpRouteRegisterer[any, any]{
s: s,
route: Route[any, any]{
BaseRoute: BaseRoute{
Method: http.MethodGet,
Path: s.OpenAPIConfig.SwaggerUrl + "/",
},
},
}, s.OpenAPIConfig.UIHandler(s.OpenAPIConfig.JsonUrl))
controller: s.OpenAPIConfig.UIHandler(s.OpenAPIConfig.JsonUrl),
})
s.printOpenAPIMessage(fmt.Sprintf("OpenAPI UI: %s%s/index.html", s.url(), s.OpenAPIConfig.SwaggerUrl))
}
}
Expand Down

0 comments on commit 19055e1

Please sign in to comment.