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
Copy file name to clipboardExpand all lines: oapi_validate.go
+17Lines changed: 17 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -74,6 +74,11 @@ type ErrorHandlerOptsMatchedRoute struct {
74
74
// MultiErrorHandler is called when the OpenAPI filter returns an openapi3.MultiError (https://pkg.go.dev/github.com/getkin/kin-openapi/openapi3#MultiError)
// Skipper is a function that runs before any validation middleware, and determines whether the given request should skip any validation middleware
78
+
//
79
+
// Return `true` if the request should be skipped
80
+
typeSkipperfunc(r*http.Request) bool
81
+
77
82
// Options allows configuring the OapiRequestValidator.
78
83
typeOptionsstruct {
79
84
// Options contains any configuration for the underlying `openapi3filter`
@@ -100,6 +105,9 @@ type Options struct {
100
105
SilenceServersWarningbool
101
106
// DoNotValidateServers ensures that there is no Host validation performed (see `SilenceServersWarning` and https://github.com/deepmap/oapi-codegen/issues/882 for more details)
102
107
DoNotValidateServersbool
108
+
109
+
// Skipper allows writing a function that runs before any middleware and determines whether the given request should skip any validation middleware
110
+
SkipperSkipper
103
111
}
104
112
105
113
// OapiRequestValidator Creates the middleware to validate that incoming requests match the given OpenAPI 3.x spec, with a default set of configuration.
// NOTE that we need to make sure that the `Servers` aren't set, otherwise the OpenAPI validation middleware will validate that the `Host` header (of incoming requests) are targeting known `Servers` in the OpenAPI spec
0 commit comments