# Functions
ConvertErrors converts all errors to the appropriate error format.
DefaultErrorEncoder writes the error to the ResponseWriter, by default a content type of text/plain, a body of the plain text of the error, and a status code of 500.
FileBodyDecoder is a body decoder that decodes a file body to a string.
JSONBodyDecoder decodes a JSON formatted body.
NewValidator returns a new response validation middleware, using the given routes from an OpenAPI 3 specification.
NoopAuthenticationFunc is an AuthenticationFunc.
OnErr provides a callback that handles writing an HTTP response on a validation error.
OnLog provides a callback that handles logging in the Validator.
RegisterBodyDecoder registers a request body's decoder for a content type.
RegisterBodyEncoder enables package-wide decoding of contentType values.
RegisteredBodyDecoder returns the registered body decoder for the given content type.
RegisteredBodyEncoder returns the registered body encoder for the given content type.
Strict, if set, causes an internal server error to be sent if the wrapped handler response fails response validation.
TrimJSONPrefix trims one of the possible prefixes.
UnregisterBodyDecoder dissociates a body decoder from a content type.
UnregisterBodyEncoder disables package-wide decoding of contentType values.
ValidateParameter validates a parameter's value by JSON schema.
ValidateRequest is used to validate the given input according to previous loaded OpenAPIv3 spec.
ValidateRequestBody validates data of a request's body.
ValidateResponse is used to validate the given input according to previous loaded OpenAPIv3 spec.
ValidateSecurityRequirements goes through multiple OpenAPI 3 security requirements in order and returns nil on the first valid requirement.
ValidationOptions sets request/response validation options on the validator.
# Constants
ErrCodeCannotFindRoute happens when the validator fails to resolve the request to a defined OpenAPI route.
ErrCodeOK indicates no error.
ErrCodeRequestInvalid happens when the inbound request does not conform to the OpenAPI 3 specification.
ErrCodeResponseInvalid happens when the wrapped handler response does not conform to the OpenAPI 3 specification.
KindInvalidFormat describes an error that happens when a value does not conform a format that is required by a serialization method.
KindOther describes an untyped parsing error.
KindUnsupportedFormat describes an error that happens when a value has an unsupported format.
# Variables
ErrAuthenticationServiceMissing is returned when no authentication service is defined for the request validator.
ErrInvalidEmptyValue is returned when a value of a parameter or request body is empty while it's not allowed.
ErrInvalidRequired is returned when a required value of a parameter or request body is not defined.
No description provided by the author
# Structs
No description provided by the author
Options used by ValidateRequest and ValidateResponse.
ParseError describes errors which happens while parse operation's parameters, requestBody, or response.
RequestError is returned by ValidateRequest when request does not match OpenAPI spec.
No description provided by the author
ResponseError is returned by ValidateResponse when response does not match OpenAPI spec.
No description provided by the author
SecurityRequirementsError is returned by ValidateSecurityRequirements when no requirement is met.
ValidationError struct provides granular error information useful for communicating issues back to end user and developer.
ValidationErrorEncoder wraps a base ErrorEncoder to handle ValidationErrors.
ValidationErrorSource struct.
No description provided by the author
Validator provides HTTP request and response validation middleware.
# Interfaces
Headerer is checked by DefaultErrorEncoder.
StatusCoder is checked by DefaultErrorEncoder.
# Type aliases
AuthenticationFunc allows for custom security requirement validation.
BodyDecoder is an interface to decode a body of a request or response.
BodyEncoder really is an (encoding/json).Marshaler.
A ContentParameterDecoder takes a parameter definition from the OpenAPI spec, and the value which we received for it.
CustomSchemaErrorFunc allows for custom the schema error message.
EncodingFn is a function that returns an encoding of a request body's part.
ErrCode is used for classification of different types of errors that may occur during validation.
ErrFunc handles errors that may occur during validation.
ErrorEncoder is responsible for encoding an error to the ResponseWriter.
LogFunc handles log messages that may occur during validation.
ParseErrorKind describes a kind of ParseError.
ValidatorOption defines an option that may be specified when creating a Validator.