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
As a means to **??**o
This has been a long-standing issue **??**
With thanks to Per, Mike and MattiasMartens who have **??**, as well as
many others in the past who have **??**
Closes#11, #27.
Co-authored-by: Per Bockman <per.bockman@gmail.com>
Co-authored-by: Mike Schinkel <mike@newclarity.net>
Co-authored-by: MattiasMartens <33037520+MattiasMartens@users.noreply.github.com>
// NOTE that this should ideally be used instead of ErrorHandler
32
+
// If both an `ErrorHandlerWithOpts` and `ErrorHandler` are set, the `ErrorHandlerWithOpts` takes precedence
33
+
typeErrorHandlerWithOptsfunc(ctx context.Context, w http.ResponseWriter, r*http.Request, optsErrorHandlerOpts)
34
+
35
+
typeErrorHandlerOptsMatchedRoutestruct {
36
+
// Route indicates the Route that this error is received by, providing full context into the OpenAPI Spec TODO
37
+
// TODO
38
+
// NOTE nil when not found
39
+
Route*routers.Route
40
+
41
+
// TODO
42
+
// NOTE nil/empty when not found
43
+
PathParamsmap[string]string
44
+
}
45
+
46
+
// ErrorHandlerOpts contains additional options that are passed to the `ErrorHandlerWithOpts` function in the case of a validation error being returned by the middleware
47
+
typeErrorHandlerOptsstruct {
48
+
// TODO
49
+
// NOTE that this will be nil if there is no matched route (i.e. it's a **??**)
50
+
MatchedRoute*ErrorHandlerOptsMatchedRoute
51
+
52
+
// Error is the underlying error that triggered this error handler to be executed.
53
+
Errorerror
54
+
55
+
// StatusCode indicates the HTTP Status Code that TODO
56
+
//
57
+
// NOTE that this is a suggestion, and can be ignored if believed to be TODO
58
+
StatusCodeint
59
+
}
60
+
26
61
// MultiErrorHandler is called when the OpenAPI filter returns an openapi3.MultiError (https://pkg.go.dev/github.com/getkin/kin-openapi/openapi3#MultiError)
// ErrorHandler is called when a validation error occurs.
34
69
//
70
+
// TODO
71
+
//
35
72
// If not provided, `http.Error` will be called
36
73
ErrorHandlerErrorHandler
74
+
75
+
// TODO
76
+
ErrorHandlerWithOptsErrorHandlerWithOpts
77
+
37
78
// MultiErrorHandler is called when there is an openapi3.MultiError (https://pkg.go.dev/github.com/getkin/kin-openapi/openapi3#MultiError) returned by the `openapi3filter`.
38
79
//
39
80
// If not provided `defaultMultiErrorHandler` will be used.
81
+
// NOTE nto called if ErrorHandlerWithOpts
40
82
MultiErrorHandlerMultiErrorHandler
41
83
// SilenceServersWarning allows silencing a warning for https://github.com/deepmap/oapi-codegen/issues/882 that reports when an OpenAPI spec has `spec.Servers != nil`
0 commit comments