Validatable

    Capable of being validated. Conformance adds a throwing validate() method.

    Validatable.swift:11
    protocol Validatable
    Browse conforming types
    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

    Show obsolete interfaces (1)

    Hide obsolete interfaces