{"modulePath":"github.com/maclav3/oapi-codegen","version":"v1.5.3","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package middleware\n\n## Constants\n\n```go\nconst EchoContextKey = \"oapi-codegen/echo-context\"\n```\n\n```go\nconst UserDataKey = \"oapi-codegen/user-data\"\n```\n\n## Functions\n\n```go\nfunc GetEchoContext(c context.Context) echo.Context\n```\nHelper function to get the echo context from within requests. It returns nil if not found or wrong type.\n\n```go\nfunc GetUserData(c context.Context) interface{}\n```\n\n```go\nfunc OapiRequestValidator(swagger *openapi3.Swagger) echo.MiddlewareFunc\n```\nCreate a validator from a swagger object.\n\n```go\nfunc OapiRequestValidatorWithOptions(swagger *openapi3.Swagger, options *Options) echo.MiddlewareFunc\n```\nCreate a validator from a swagger object, with validation options\n\n```go\nfunc OapiValidatorFromYamlFile(path string) (echo.MiddlewareFunc, error)\n```\nCreate validator middleware from a YAML file path\n\n```go\nfunc ValidateRequestFromContext(ctx echo.Context, router *openapi3filter.Router, options *Options) error\n```\nThis function is called from the middleware above and actually does the work of validating a request.\n\n## Types\n\n```go\ntype Options struct {\n\tOptions      openapi3filter.Options\n\tParamDecoder openapi3filter.ContentParameterDecoder\n\tUserData     interface{}\n\tSkipper      echomiddleware.Skipper\n}\n```\nOptions to customize request validation. These are passed through to openapi3filter.\n\n","path":"github.com/maclav3/oapi-codegen/pkg/middleware","name":"middleware","synopsis":"","isRedistributable":true}
