Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Joi the max() validation is not respected. #155

Open
douglas1983 opened this issue Dec 15, 2021 · 0 comments
Open

Joi the max() validation is not respected. #155

douglas1983 opened this issue Dec 15, 2021 · 0 comments

Comments

@douglas1983
Copy link

In the Felicity.example() method, when in joiSchema there is a pattern() validation, the max() validation is not respected.

const payeeSchema = {
bank_identifier: Joi.number().integer().min(1).max(999).required(),
bank_branch: Joi.string().trim().pattern(/^\w+(?:\s+\w+)$/).max(4).required(),
bank_branch_identifier: Joi.string().trim().pattern(/^\w+(?:\s+\w+)
$/).max(1).required(),
bank_account: Joi.string().trim().pattern(/^\w+(?:\s+\w+)$/).max(12).required(),
bank_account_identifier:Joi.string().trim().pattern(/^\w+(?:\s+\w+)
$/).max(1).required(),
registered_number:Joi.number().integer().min(1).max(99999999999999),
type:Joi.number().integer().valid(1, 2).required(),
name:Joi.string().trim().pattern(/^\w+(?:\s+\w+)*$/).max(30).required()
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant