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
// MultiErrorHandler is called when oapi returns a MultiError type
29
+
// MultiErrorHandler is called when the OpenAPI filter returns an openapi3.MultiError (https://pkg.go.dev/github.com/getkin/kin-openapi/openapi3#MultiError)
// Options to customize request validation, openapi3filter specified options will be passed through.
32
+
// Options allows configuring the OapiRequestValidator.
33
33
typeOptionsstruct {
34
-
Options openapi3filter.Options
35
-
ErrorHandlerErrorHandler
34
+
// Options contains any filters for the underlying `openapi3filter`
35
+
Options openapi3filter.Options
36
+
// TODO
37
+
// ErrorHandler is called when a validation error **??** TODO
38
+
// If not provided, `http.Error` will be called
39
+
ErrorHandlerErrorHandler
40
+
// MultiErrorHandler is called when there is an openapi3.MultiError (https://pkg.go.dev/github.com/getkin/kin-openapi/openapi3#MultiError) returned by the `openapi3filter`.
41
+
// If not provided `defaultMultiErrorHandler` will be used.
42
+
// TODO
43
+
// TODO
36
44
MultiErrorHandlerMultiErrorHandler
37
45
// SilenceServersWarning allows silencing a warning for https://github.com/deepmap/oapi-codegen/issues/882 that reports when an OpenAPI spec has `spec.Servers != nil`
38
46
SilenceServersWarningbool
39
47
}
40
48
49
+
// TODO
41
50
// OapiRequestValidator Creates middleware to validate request by OpenAPI spec.
log.Println("WARN: OapiRequestValidatorWithOptions called with an OpenAPI spec that has `Servers` set. This may lead to an HTTP 400 with `no matching operation was found` when sending a valid request, as the validator performs `Host` header validation. If you're expecting `Host` header validation, you can silence this warning by setting `Options.SilenceServersWarning = true`. See https://github.com/deepmap/oapi-codegen/issues/882 for more information.")
0 commit comments