Documentation ¶
Index ¶
- Constants
- func GetGinContext(c context.Context) *gin.Contextdeprecated
- func GetUserData(c context.Context) interface{}
- func OapiRequestValidator(swagger *openapi3.T) gin.HandlerFuncdeprecated
- func OapiRequestValidatorWithOptions(swagger *openapi3.T, options *Options) gin.HandlerFuncdeprecated
- func OapiValidatorFromYamlFile(path string) (gin.HandlerFunc, error)deprecated
- func ValidateRequestFromContext(c *gin.Context, router routers.Router, options *Options) errordeprecated
- type ErrorHandlerdeprecated
- type MultiErrorHandlerdeprecated
- type Optionsdeprecated
Constants ¶
const ( GinContextKey = "oapi-codegen/gin-context" UserDataKey = "oapi-codegen/user-data" )
Variables ¶
This section is empty.
Functions ¶
func GetGinContext
deprecated
GetGinContext gets the echo context from within requests. It returns nil if not found or wrong type.
Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/gin-middleware#GetGinContext
func GetUserData ¶
func OapiRequestValidator
deprecated
func OapiRequestValidator(swagger *openapi3.T) gin.HandlerFunc
OapiRequestValidator is an gin 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
Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/gin-middleware#OapiRequestValidator
func OapiRequestValidatorWithOptions
deprecated
func OapiRequestValidatorWithOptions(swagger *openapi3.T, options *Options) gin.HandlerFunc
OapiRequestValidatorWithOptions creates a validator from a swagger object, with validation options
Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/gin-middleware#OapiRequestValidatorWithOptions
func OapiValidatorFromYamlFile
deprecated
func OapiValidatorFromYamlFile(path string) (gin.HandlerFunc, error)
OapiValidatorFromYamlFile creates a validator middleware from a YAML file path
Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/gin-middleware#OapiValidatorFromYamlFile
func ValidateRequestFromContext
deprecated
ValidateRequestFromContext is called from the middleware above and actually does the work of validating a request.
Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/gin-middleware#ValidateRequestFromContext
Types ¶
type ErrorHandler
deprecated
added in
v1.11.0
ErrorHandler is called when there is an error in validation
Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/gin-middleware#ErrorHandler
type MultiErrorHandler
deprecated
added in
v1.12.0
type MultiErrorHandler func(openapi3.MultiError) error
MultiErrorHandler is called when oapi returns a MultiError type
Deprecated: This has been replaced by https://pkg.go.dev/github.com/oapi-codegen/gin-middleware#MultiErrorHandler
type Options
deprecated
type Options struct { ErrorHandler ErrorHandler Options openapi3filter.Options ParamDecoder openapi3filter.ContentParameterDecoder UserData interface{} 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 https://pkg.go.dev/github.com/oapi-codegen/gin-middleware#Options