Documentation
¶
Index ¶
- func JSONContentType(next http.Handler) http.Handler
- func OapiRequestValidator(swagger *openapi3.T, handler ErrorHandler) func(next http.Handler) http.Handler
- func OapiRequestValidatorWithOptions(swagger *openapi3.T, handler ErrorHandler, options *Options) func(next http.Handler) http.Handler
- type ErrorHandler
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JSONContentType ¶
JSONContentType adds a proper content-type header for JSON apis
func OapiRequestValidator ¶
func OapiRequestValidator(swagger *openapi3.T, handler ErrorHandler) func(next http.Handler) http.Handler
OapiRequestValidator Creates middleware to validate request by swagger spec. This middleware is good for net/http either since go-chi is 100% compatible with net/http.
func OapiRequestValidatorWithOptions ¶
func OapiRequestValidatorWithOptions(swagger *openapi3.T, handler ErrorHandler, options *Options) func(next http.Handler) http.Handler
OapiRequestValidatorWithOptions Creates middleware to validate request by swagger spec. This middleware is good for net/http either since go-chi is 100% compatible with net/http.
Types ¶
type ErrorHandler ¶
type ErrorHandler func(w http.ResponseWriter, statusCode int, message string)
ErrorHandler is called when there is an error in validation
type Options ¶
type Options struct {
Options openapi3filter.Options
}
Options to customize request validation, openapi3filter specified options will be passed through.
Click to show internal directories.
Click to hide internal directories.