You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
used with (hapi, standalone, ...): expressjs ~4.14.0, joi ^10.1.0, express-validation ^1.0.1
any other relevant information:
What are you trying to achieve or the steps to reproduce ?
I am trying to have the following work:
When I have a boolean called private who is default, if its provided as true, I want to expect a password to be required with a min length of 6, otherwise, I don't want to accept a password.
My input in the request:
{
...
private: false...}
Here is what I have for the initial input validation using express-validation:
I've also tried password: Joi.string() and password: Joi.string().optional() but they result in the same response.
If I pass the password field in the input with private I get the expected password is not allowed and if I set private to true, everything is fine. Its just when I don't pass the password field which results in the below error.
Which result you had ?
I get the following:
{ [ValidationException: Invalid UpdateExpression: An expression attribute value used in expression is not defined; attribute value: :password] message: 'Invalid UpdateExpression: An expression attribute value used in expression is not defined; attribute value: :password', code: 'ValidationException', time: Sun Jan 08 2017 22:38:17 GMT+0000 (UTC), requestId: 'REDACTED', statusCode: 400, retryable: false, retryDelay: 0 }
What did you expect ?
A successful update to the database.
The text was updated successfully, but these errors were encountered:
Context
expressjs ~4.14.0
,joi ^10.1.0
,express-validation ^1.0.1
What are you trying to achieve or the steps to reproduce ?
I am trying to have the following work:
When I have a boolean called private who is default, if its provided as true, I want to expect a password to be required with a min length of 6, otherwise, I don't want to accept a password.
My input in the request:
Here is what I have for the initial input validation using
express-validation
:The section above passes validation, however, I have also defined my DB schema using vogels:
I've also tried
password: Joi.string()
andpassword: Joi.string().optional()
but they result in the same response.If I pass the
password
field in the input withprivate
I get the expectedpassword is not allowed
and if I set private to true, everything is fine. Its just when I don't pass thepassword
field which results in the below error.Which result you had ?
I get the following:
What did you expect ?
A successful update to the database.
The text was updated successfully, but these errors were encountered: