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

Are all errors supposed to be returned? #66

Open
germanliu opened this issue Jun 2, 2020 · 1 comment
Open

Are all errors supposed to be returned? #66

germanliu opened this issue Jun 2, 2020 · 1 comment

Comments

@germanliu
Copy link

Hi and thanks for the plugin!

From the documentation I understand that all the validation errors should come at once. However, it is returning one error only.

For example, I have two unique fields in my schema (username and email). If I try to create a document where neither username nor email are unique the response I get is only saying that the email is not unique. However if I change the email to something unique and leave the username as before, then I receive a response saying that the username is not unique.

Is this the intended behavior? Or should I be receiving one response with all the validation errors?

Thanks in advance!

@varqasim
Copy link

I think it is intentional, since it stops as it hits the first error it catches that is why. So it doesn't hit an error and continue to catch the rest, but just stops at the first error it reaches and throw it.

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

2 participants