Skip to content

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

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

Closed
wants to merge 1 commit into 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
}

@jamietanna
Copy link
Member

Thanks all for the patience and suggestions - I'm looking at getting this tackled via #35 - please take a look at the signature and let me know thoughts

(This will be merged in the next couple of days, and anyone who's contributed suggestions will get a Co-Authored-By in this change, so even though it won't show as a "merged PR" from you, it'll definitely show as you having contributed to the work!)

@pebo pebo closed this Apr 24, 2025
@pebo pebo deleted the feat/add-context-breaking branch April 24, 2025 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Add context to ErrorHandler
3 participants