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
which support plan is this issue covered by?
Community
is this issue currently blocking your project?
Partially
is this issue affecting a production system?
No
Context
node version:
v10.8.0
module version:
17.1.0
environment (e.g. node, browser, native):
node.js
used with (e.g. hapi application, another framework, standalone, ...):
another framework (strapi)
any other relevant information:
How can we help?
Hi,
As in the title, I want to return just one error message for every field.
I tried error() and it just returns the very first error even {abortEarly: false} is set.
I tried message(), messages(), rule() with ruleset and either they did nothing or I got "Error: Cannot set flag inside a ruleset". I just want to do a very simple thing but couldn't for 3-4 hours. I read documents and issues and tried all I understand, as listed above. Some were legacy (belongs to older versions) some were not worked.
How can I achieve this?
Thanks!
The text was updated successfully, but these errors were encountered:
You either get one error for the entire validation process or you get every single error found. If you are using error() it will override all other errors because it is designed to return custom errors and not joi validation errors. You will need to write your own error processor that consolidates the errors per field. Not sure how that will work if you have sub field, but this is not a common use case.
Support plan
Community
Partially
No
Context
v10.8.0
17.1.0
node.js
another framework (strapi)
How can we help?
Hi,
As in the title, I want to return just one error message for every field.
I tried error() and it just returns the very first error even
{abortEarly: false}
is set.I tried message(), messages(), rule() with ruleset and either they did nothing or I got "Error: Cannot set flag inside a ruleset". I just want to do a very simple thing but couldn't for 3-4 hours. I read documents and issues and tried all I understand, as listed above. Some were legacy (belongs to older versions) some were not worked.
How can I achieve this?
Thanks!
The text was updated successfully, but these errors were encountered: