oapi-codegen
oapi-codegen copied to clipboard
Strict Server Middlewares are hard to reuse.
type StrictHandlerFunc func(ctx context.Context, w http.ResponseWriter, r *http.Request, args interface{}) (interface{}, error)
type StrictMiddlewareFunc func(f StrictHandlerFunc, operationID string) StrictHandlerFunc
Types are generated with the api and are part of the package of the api.
This makes it very difficult to reuse a middleware
I would suggest to add them to a part of the library and reuse them as part of the generated code.