echomiddleware package - github.com/oapi-codegen/echo-middleware - Go Packages

View Source

const (
	EchoContextKey = "oapi-codegen/echo-context"
	UserDataKey    = "oapi-codegen/user-data"
)

This section is empty.

GetEchoContext gets the echo context from within requests. It returns nil if not found or wrong type.

OapiRequestValidator creates a validator from a swagger object.

OapiRequestValidatorWithOptions creates a validator from a swagger object, with validation options

OapiValidatorFromYamlFile is an Echo 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. Create validator middleware from a YAML file path

ValidateRequestFromContext is called from the middleware above and actually does the work of validating a request.

type ErrorHandler

ErrorHandler is called when there is an error in validation

type MultiErrorHandler

MultiErrorHandler is called when oapi returns a MultiError type

Options to customize request validation. These are passed through to openapi3filter.