Documentation
¶
Overview ¶
Package openapi contains middleware to validate requests against an OpenAPI schema.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Validator ¶
Validator 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.
This code is taken from the oapi-codegen package and has been modified to return JSON error responses rather than plaintext ones.
func ValidatorWithOptions ¶
func ValidatorWithOptions(swagger *openapi3.T, options *Options) func(next http.Handler) http.Handler
ValidatorWithOptions 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.
This code is taken from the oapi-codegen package and has been modified to return JSON error responses rather than plaintext ones.
Types ¶
type Options ¶
type Options struct {
Options openapi3filter.Options
}
Options to customize request validation, openapi3filter specified options will be passed through.