{"modulePath":"github.com/deepmap/oapi-codegen","version":"v1.16.3","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package middleware\n\nPackage middleware implements middleware function for server implementations, 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.\n\n## Functions\n\n```go\nfunc GetFiberContext(c context.Context) *fiber.Ctx\n```\nGetFiberContext gets the fiber context from within requests. It returns nil if not found or wrong type.\n\nDeprecated: This has been replaced by [https://pkg.go.dev/github.com/oapi-codegen/fiber-middleware#GetFiberContext](https://pkg.go.dev/github.com/oapi-codegen/fiber-middleware#GetFiberContext)\n\n```go\nfunc GetUserData(c context.Context) interface{}\n```\nDeprecated: This has been replaced by [https://pkg.go.dev/github.com/oapi-codegen/fiber-middleware#GetUserData](https://pkg.go.dev/github.com/oapi-codegen/fiber-middleware#GetUserData)\n\n```go\nfunc OapiRequestValidator(swagger *openapi3.T) fiber.Handler\n```\nOapiRequestValidator is a fiber 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 with error message\n\nDeprecated: This has been replaced by [https://pkg.go.dev/github.com/oapi-codegen/fiber-middleware#OapiRequestValidator](https://pkg.go.dev/github.com/oapi-codegen/fiber-middleware#OapiRequestValidator)\n\n```go\nfunc OapiRequestValidatorWithOptions(swagger *openapi3.T, options *Options) fiber.Handler\n```\nOapiRequestValidatorWithOptions creates a validator from a swagger object, with validation options\n\nDeprecated: This has been replaced by [https://pkg.go.dev/github.com/oapi-codegen/fiber-middleware#OapiRequestValidatorWithOptions](https://pkg.go.dev/github.com/oapi-codegen/fiber-middleware#OapiRequestValidatorWithOptions)\n\n```go\nfunc OapiValidatorFromYamlFile(path string) (fiber.Handler, error)\n```\nOapiValidatorFromYamlFile creates a validator middleware from a YAML file path\n\nDeprecated: This has been replaced by [https://pkg.go.dev/github.com/oapi-codegen/fiber-middleware#OapiValidatorFromYamlFile](https://pkg.go.dev/github.com/oapi-codegen/fiber-middleware#OapiValidatorFromYamlFile)\n\n```go\nfunc ValidateRequestFromContext(c *fiber.Ctx, router routers.Router, options *Options) error\n```\nValidateRequestFromContext is called from the middleware above and actually does the work of validating a request.\n\nDeprecated: This has been replaced by [https://pkg.go.dev/github.com/oapi-codegen/fiber-middleware#ValidateRequestFromContext](https://pkg.go.dev/github.com/oapi-codegen/fiber-middleware#ValidateRequestFromContext)\n\n## Types\n\n```go\ntype ErrorHandler func(c *fiber.Ctx, message string, statusCode int)\n```\nErrorHandler is called when there is an error in validation\n\nDeprecated: This has been replaced by [https://pkg.go.dev/github.com/oapi-codegen/fiber-middleware#ErrorHandler](https://pkg.go.dev/github.com/oapi-codegen/fiber-middleware#ErrorHandler)\n\n```go\ntype MultiErrorHandler func(openapi3.MultiError) error\n```\nMultiErrorHandler is called when oapi returns a MultiError type\n\nDeprecated: This has been replaced by [https://pkg.go.dev/github.com/oapi-codegen/fiber-middleware#MultiErrorHandler](https://pkg.go.dev/github.com/oapi-codegen/fiber-middleware#MultiErrorHandler)\n\n```go\ntype Options struct {\n\tOptions           openapi3filter.Options\n\tErrorHandler      ErrorHandler\n\tParamDecoder      openapi3filter.ContentParameterDecoder\n\tUserData          interface{}\n\tMultiErrorHandler MultiErrorHandler\n}\n```\nOptions to customize request validation. These are passed through to openapi3filter.\n\nDeprecated: This has been replaced by [https://pkg.go.dev/github.com/oapi-codegen/fiber-middleware#Options](https://pkg.go.dev/github.com/oapi-codegen/fiber-middleware#Options)\n\n","path":"github.com/deepmap/oapi-codegen/pkg/fiber-middleware","name":"middleware","synopsis":"Package middleware implements middleware function for server implementations, which validates incoming HTTP requests to make sure that they conform to the given OAPI 3.0 specification.","isRedistributable":true}
