Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithRequestValidation ¶
func WithRequestValidation(options MiddlewareOptions) middleware
WithRequestValidation returns a middleware that validates against request. It immediately returns an error response and does not call next handler if validation failed.
func WithResponseValidation ¶
func WithResponseValidation(options MiddlewareOptions) middleware
WithResponseValidation returns a middleware that validates against response. It may consume larger memory because it holds entire response body to validate it later.
func WithValidation ¶
func WithValidation(options MiddlewareOptions) middleware
WithValidation returns a middleware that validates against both request and response.
Types ¶
type MiddlewareOptions ¶
type MiddlewareOptions struct { Router routers.Router ValidationOptions *openapi3filter.Options ReportFindRouteError func(w http.ResponseWriter, r *http.Request, err error) ReportRequestValidationError func(w http.ResponseWriter, r *http.Request, err error) ReportResponseValidationError func(w http.ResponseWriter, r *http.Request, err error) TracerProvider trace.TracerProvider }
Click to show internal directories.
Click to hide internal directories.