You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This would be a breaking change, but for us, a good thing if these openapi3filter/middleware.go's types were instead
// ErrFunc handles errors that may occur during validation.
type ErrFunc func(ctx context.Context, w http.ResponseWriter, status int, code ErrCode, err error)
// LogFunc handles log messages that may occur during validation.
type LogFunc func(ctx context.Context, message string, err error)
And invoked by the middleware with r.Context(). This way, the logging and error handling functions can access important info from the request context, like tracingIDs, requestIDs, deadline information, etc.
It might not be a breaking change if additional handler functions are added (ErrWithContextFunc and LogWithContextFunc?) for additional complexity.
If one of these approaches is acceptable, I can contribute a MR.
The text was updated successfully, but these errors were encountered:
This would be a breaking change, but for us, a good thing if these openapi3filter/middleware.go's types were instead
And invoked by the middleware with
r.Context()
. This way, the logging and error handling functions can access important info from the request context, like tracingIDs, requestIDs, deadline information, etc.It might not be a breaking change if additional handler functions are added (
ErrWithContextFunc
andLogWithContextFunc
?) for additional complexity.If one of these approaches is acceptable, I can contribute a MR.
The text was updated successfully, but these errors were encountered: