Protocol
Validatable
Capable of being validated. Conformance adds a throwing
validate() method.protocol Validatable
Overview
struct User: Validatable {
var name: String
var age: Int
static func validations() -> [Validation] {
[Validation(key: "name", validator: .count(5...) && .alphanumeric)]
}
}
Topics
Type Methods
static func validate(any Decoder) throwsstatic func validate(content: Request) async throwsstatic func validate(json: String, contentConfiguration: ContentConfiguration) throwsstatic func validate(query: Request) throwsstatic func validate(query: URI, contentConfiguration: ContentConfiguration) throwsstatic func validations() -> Validationsstatic func validations(inout Validations)