package
0.90.0
Repository: https://github.com/tyktechnologies/kin-openapi.git
Documentation: pkg.go.dev

# Functions

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.
NewValidator returns a new response validation middlware, using the given routes from an OpenAPI 3 specification.
No description provided by the author
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.
RegisteredBodyDecoder returns the registered body decoder 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.
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.

# 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

DefaultOptions do not set an AuthenticationFunc.
ErrAuthenticationServiceMissing is returned when no authentication service is defined for the request validator.
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

No description provided by the author
BodyDecoder is an interface to decode a body of a request or response.
A ContentParameterDecoder takes a parameter definition from the OpenAPI spec, and the value which we received for it.
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.