Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OpenAPIValidation ¶
type OpenAPIValidation struct {
// contains filtered or unexported fields
}
OpenAPIValidation middleware validates HTTP requests against OpenAPI spec.
func NewOpenAPIValidation ¶
func NewOpenAPIValidation( openAPISpecBytes []byte, options OpenAPIValidationOptions, ) (*OpenAPIValidation, error)
NewOpenAPIValidation creates OpenAPIValidation object from OAS3 spec file and provided options
func (*OpenAPIValidation) Middleware ¶
func (openapi *OpenAPIValidation) Middleware(next http.Handler) http.Handler
Middleware returns a middleware function
type OpenAPIValidationOptions ¶
type OpenAPIValidationOptions struct { // If true, ignore "security" in openapi.yaml. IgnoreAuthentication bool // If true, ignore "server" declarations in openapi.yaml when validating requests paths. Only consider the paths // relative to the server url versus checking the full paths (which include the server URL) in the requests. IgnoreServers bool // Must be set to path prefix, where API is deployed. E.g. "/v1" APIPrefix string }
Click to show internal directories.
Click to hide internal directories.