How to validate parameters in Flask

Solution
from flask_parameter_validation import ValidateParameters, Json

@name_space.route("/test", methods=["POST"])
@ValidateParameters()
def hello(
        username: str = Json(
            min_str_length=10,
            max_str_length=1024,
            pattern=r"REGEX"
        )
     ):
    return f"Hello, {username}"