ResponseValidator
public struct ResponseValidator<Body, Error> where Error : Error
A value type used to validate a RequestResponse
-
Create a
ResponseValidatorDeclaration
Swift
public init(_ handler: @escaping Handler)Parameters
handlerThe closure used to validate
-
Specialized
RequestResponsethat this validator can validateDeclaration
Swift
public typealias Response = RequestResponse<Body> -
The validation handler
Declaration
Swift
public let validate: Handler -
An unsafe response validator, which never returns an error, regardless of the content of the response
Declaration
Swift
static var unsafe: `Self` { get }
-
The default response validator for
HTTPErrortypes, which returns an error based on the status codeDeclaration
Swift
static var `default`: `Self` { get }
View on GitHub
Install in Dash
ResponseValidator Structure Reference