Documentation ¶
Index ¶
- Constants
- func GetEchoContext(c context.Context) echo.Context
- func GetUserData(c context.Context) interface{}
- func OapiRequestValidator(swagger *openapi3.Swagger) echo.MiddlewareFunc
- func OapiRequestValidatorWithOptions(swagger *openapi3.Swagger, options *Options) echo.MiddlewareFunc
- func OapiValidatorFromYamlFile(path string) (echo.MiddlewareFunc, error)
- func ValidateRequestFromContext(ctx echo.Context, router routers.Router, options *Options) error
- type Options
Constants ¶
View Source
const EchoContextKey = "oapi-codegen/echo-context"
View Source
const UserDataKey = "oapi-codegen/user-data"
Variables ¶
This section is empty.
Functions ¶
func GetEchoContext ¶
Helper function to get the echo context from within requests. It returns nil if not found or wrong type.
func GetUserData ¶
func OapiRequestValidator ¶
Create a validator from a swagger object.
func OapiRequestValidatorWithOptions ¶
func OapiRequestValidatorWithOptions(swagger *openapi3.Swagger, options *Options) echo.MiddlewareFunc
Create a validator from a swagger object, with validation options
func OapiValidatorFromYamlFile ¶
Create validator middleware from a YAML file path
Types ¶
type Options ¶
type Options struct { Options openapi3filter.Options ParamDecoder openapi3filter.ContentParameterDecoder UserData interface{} Skipper echomiddleware.Skipper }
Options to customize request validation. These are passed through to openapi3filter.
Click to show internal directories.
Click to hide internal directories.