Validation

Validation rules are defined in the schema using simple JSON syntax.

The match rule uses regular expressions. For example, "^[a-zA-Z0-9]+$" ensures the value contains only English letters (uppercase or lowercase) and digits, no spaces or special characters allowed.
The minLength and maxLength rules enforce boundaries on string length, useful for things like usernames, passwords, or titles.

Other supported validation properties include: required (ensures the field is not empty), enum (restricts to predefined values), min and max (for numeric boundaries).

{
    "schema": {
        "username": {
            "type": "string",
            "match": "^[a-zA-Z0-9]+$"
        },
        "password": {
            "type": "hash", 
            "minLength": 3,
            "maxLength": 15
        }
    }
}
Edit this page on Github
© 2025 kav3.com. Crafted with and dedication.