Skip to content

Commit

Permalink
Removes confusing handler field in BaseRoute
Browse files Browse the repository at this point in the history
It was not used as real handler and was net/http specific
  • Loading branch information
EwenQuim committed Dec 22, 2024
1 parent d556b3b commit a0f00d5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 2 additions & 2 deletions mux.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func Register[T, B any](s *Server, route Route[T, B], controller http.Handler, o
for _, o := range options {
o(&route.BaseRoute)
}
route.Handler = controller

route.Path = s.basePath + route.Path

fullPath := route.Path
Expand All @@ -84,7 +84,7 @@ func Register[T, B any](s *Server, route Route[T, B], controller http.Handler, o
slog.Debug("registering controller " + fullPath)

route.Middlewares = append(s.middlewares, route.Middlewares...)
s.Mux.Handle(fullPath, withMiddlewares(route.Handler, route.Middlewares...))
s.Mux.Handle(fullPath, withMiddlewares(controller, route.Middlewares...))

err := route.RegisterOpenAPIOperation(s.OpenAPI)
if err != nil {
Expand Down
3 changes: 0 additions & 3 deletions route.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ type BaseRoute struct {
// URL path. Will be prefixed by the base path of the server and the group path if any
Path string

// handler executed for this route
Handler http.Handler

// namespace and name of the function to execute
FullName string
Params map[string]OpenAPIParam
Expand Down

0 comments on commit a0f00d5

Please sign in to comment.