Documentation
¶
Index ¶
- Constants
- func GetEchoContext(c context.Context) echo.Contextdeprecated
- func GetUserData(c context.Context) interface{}deprecated
- func OapiRequestValidator(swagger *openapi3.T) echo.MiddlewareFuncdeprecated
- func OapiRequestValidatorWithOptions(swagger *openapi3.T, options *Options) echo.MiddlewareFuncdeprecated
- func OapiValidatorFromYamlFile(path string) (echo.MiddlewareFunc, error)deprecated
- func ValidateRequestFromContext(ctx echo.Context, router routers.Router, options *Options) *echo.HTTPErrordeprecated
- type ErrorHandlerdeprecated
- type MultiErrorHandlerdeprecated
- type Optionsdeprecated
Constants ¶
const ( EchoContextKey = "oapi-codegen/echo-context" UserDataKey = "oapi-codegen/user-data" )
Variables ¶
This section is empty.
Functions ¶
func GetEchoContext
deprecated
added in
v1.1.6
func GetUserData
deprecated
added in
v1.1.6
func OapiRequestValidator
deprecated
func OapiRequestValidatorWithOptions
deprecated
added in
v1.1.6
OapiRequestValidatorWithOptions creates a validator from a swagger object, with validation options
Deprecated: This has been replaced by github.com/oapi-codegen/echo-middleware#OapiRequestValidatorWithOptions
func OapiValidatorFromYamlFile
deprecated
OapiValidatorFromYamlFile is an Echo middleware function which validates incoming HTTP requests to make sure that they conform to the given OAPI 3.0 specification. When OAPI validation fails on the request, we return an HTTP/400. Create validator middleware from a YAML file path
Deprecated: This has been replaced by github.com/oapi-codegen/echo-middleware#OapiValidatorFromYamlFile
func ValidateRequestFromContext
deprecated
func ValidateRequestFromContext(ctx echo.Context, router routers.Router, options *Options) *echo.HTTPError
ValidateRequestFromContext is called from the middleware above and actually does the work of validating a request.
Deprecated: This has been replaced by github.com/oapi-codegen/echo-middleware#ValidateRequestFromContext
Types ¶
type ErrorHandler
deprecated
added in
v1.11.0
type ErrorHandler func(c echo.Context, err *echo.HTTPError) error
ErrorHandler is called when there is an error in validation
Deprecated: This has been replaced by github.com/oapi-codegen/echo-middleware#ErrorHandler
type MultiErrorHandler
deprecated
added in
v1.12.0
type MultiErrorHandler func(openapi3.MultiError) *echo.HTTPError
MultiErrorHandler is called when oapi returns a MultiError type
Deprecated: This has been replaced by github.com/oapi-codegen/echo-middleware#MultiErrorHandler
type Options
deprecated
added in
v1.1.6
type Options struct {
ErrorHandler ErrorHandler
Options openapi3filter.Options
ParamDecoder openapi3filter.ContentParameterDecoder
UserData interface{}
Skipper echomiddleware.Skipper
MultiErrorHandler MultiErrorHandler
// SilenceServersWarning allows silencing a warning for https://github.com/deepmap/oapi-codegen/issues/882 that reports when an OpenAPI spec has `spec.Servers != nil`
SilenceServersWarning bool
}
Options to customize request validation. These are passed through to openapi3filter.
Deprecated: This has been replaced by github.com/oapi-codegen/echo-middleware#Options