Protocolvapor 4.106.2Vapor
Validatable
Capable of being validated. Conformance adds a throwing validate()
method.
protocol Validatable
struct User: Validatable {
var name: String
var age: Int
static func validations() -> [Validation] {
[Validation(key: "name", validator: .count(5...) && .alphanumeric)]
}
}
Requirements
Type members
Citizens in Vapor
Type members
static func validate(Decoder
) throws static func validate(content: Request
) throws static func validate(json: String
) throws static func validate(query: URI
) throws static func validate(query: Request
) throws static func validations(
) -> Validations