Vapor Documentation Beta

Structure Validations

public struct Validations

Initializers

init()

public init()

Methods

add(_:​as:​is:​required:​)

public mutating func add<T>(_ key: ValidationKey, as type: T.Type = T.self, is validator: Validator<T> = .valid, required: Bool = true)

add(_:​result:​)

public mutating func add(_ key: ValidationKey, result: ValidatorResult)

add(_:​required:​_:​)

public mutating func add(_ key: ValidationKey, required: Bool = true, _ nested: (inout Validations) -> ())

validate(request:​)

public func validate(request: Request) throws -> ValidationsResult

validate(query:​)

public func validate(query: URI) throws -> ValidationsResult

validate(json:​)

public func validate(json: String) throws -> ValidationsResult

validate(_:​)

public func validate(_ decoder: Decoder) throws -> ValidationsResult