Conceptual
Login

Writing a Custom Validator for a Field

When no built-in rule says what you mean, you can attach your own function to a field: it receives the value, returns true or false, and carries its own error message. That is how you express rules such as a password that must contain more than one kind of character, or a display name that may not look like an email address. Writing the rule into the schema keeps it next to the field instead of copied into every route that touches it.