Documentation
¶
Index ¶
- func OapiRequestValidator(swagger *openapi3.T) echo.MiddlewareFunc
- func OapiRequestValidatorWithOptions(swagger *openapi3.T, options *Options) echo.MiddlewareFunc
- func UnicodePrintableCharsChecker(next echo.HandlerFunc) echo.HandlerFunc
- func UnicodePrintableCharsCheckerMiddleware() echo.MiddlewareFunc
- func ValidateQuery(values url.Values, query interface{}) error
- func ValidateRequestFromContext(ctx echo.Context, router routers.Router, options *Options) *echo.HTTPError
- type Echokeys
- type ErrorHandler
- type Manager
- type MultiErrorHandler
- type Options
- type RESTHandlers
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OapiRequestValidator ¶
func OapiRequestValidator(swagger *openapi3.T) echo.MiddlewareFunc
OapiRequestValidator creates a validator from a swagger object.
func OapiRequestValidatorWithOptions ¶
func OapiRequestValidatorWithOptions(swagger *openapi3.T, options *Options) echo.MiddlewareFunc
OapiRequestValidatorWithOptions creates a validator from a swagger object, with validation options.
func UnicodePrintableCharsChecker ¶
func UnicodePrintableCharsChecker(next echo.HandlerFunc) echo.HandlerFunc
UnicodePrintableCharsChecker checks if the request body contains just unicode characters and returns error if it finds any non unicode characters.
func UnicodePrintableCharsCheckerMiddleware ¶
func UnicodePrintableCharsCheckerMiddleware() echo.MiddlewareFunc
func ValidateQuery ¶
ValidateQuery performs the validation of an expected set of fields contained in a query struct against the provided query parameters of an HTTP request. If the query expects values and those match the provided values, the validation returns nil, otherwise it resturns an error. It uses ToMapKeys function to get the names of the fields of a query struct, and then uses QueryChecker to validate those fields against the provided query values.
Types ¶
type ErrorHandler ¶
ErrorHandler is called when there is an error in validation.
type Manager ¶
func NewManager ¶
type MultiErrorHandler ¶
type MultiErrorHandler func(openapi3.MultiError) *echo.HTTPError
MultiErrorHandler is called when oapi returns a MultiError type.
type Options ¶
type Options struct {
ErrorHandler ErrorHandler
Options openapi3filter.Options
ParamDecoder openapi3filter.ContentParameterDecoder
UserData interface{}
Skipper echomiddleware.Skipper
MultiErrorHandler MultiErrorHandler
SilenceServersWarning bool
}
Options to customize request validation. These are passed through to openapi3filter.