Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: add context param to error handler func #13

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pebo
Copy link

@pebo pebo commented Feb 13, 2024

Fixes #11 with a breaking change

@pebo pebo requested a review from a team as a code owner February 13, 2024 21:13
This was referenced Apr 25, 2024
@dimovnike
Copy link

this can be done without breaking changes. Add new pair of functions in options:

ErrorHandlerWithCtx: func(ctx context.Context, w http.ResponseWriter, message string, statusCode int)

type Options struct {
	Options           openapi3filter.Options
        ErrorHandlerWithCtx      ErrorHandlerWithCtx // takes priority when set
	MultiErrorHandlerWithCtx MultiErrorHandlerWithCtx // takes priority when set
	ErrorHandler      ErrorHandler
	MultiErrorHandler MultiErrorHandler
	// SilenceServersWarning allows silencing a warning for https://github.com/deepmap/oapi-codegen/issues/882 that reports when an OpenAPI spec has `spec.Servers != nil`
	SilenceServersWarning bool
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add context to ErrorHandler
2 participants