This Package is inspired by Joi
Use pip for installation
pip install flask-guardian
from flask_guardian.rules import Rules
my_rules = {
"login": Rules().Required().String().Max(20),
"password": Rules().Required().String().Min(8).Max(120)
}
@app.route("/login", methods=["POST"])
@Validator(my_rules)
def login_():
'''your code here'''
Verify if the parameter is a string.
Verify if the parameter is an integer.
Using a regex, verify if the parameter is conform with email format.
Verify if the parameter len is more than x.
Verify if the parameter len is less or equal than x.
Verify if the parameter contains at least one argument of the array.
Verify if the parameter not contains any argument of the array.
Verify if the parameter equal x.
Verify if the parameter not equal x.