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

Confusing error message while using minItems #171

Open
caleblawrence opened this issue May 24, 2023 · 0 comments
Open

Confusing error message while using minItems #171

caleblawrence opened this issue May 24, 2023 · 0 comments

Comments

@caleblawrence
Copy link

caleblawrence commented May 24, 2023

I could be using this wrong but I'm validating a schema that has minItems: 1 in it like this:

{
   operators: {
      type: 'array',
      minItems: 1,
      items: {...}
  }
}

and it's leading to an awkward error message like this: /operators: minItems must NOT have fewer than 1 items when ideally it would be more like /operators: must NOT have fewer than 1 items

It looks like thats due to how DefaultValidationError => getError() is putting a keyword in front of the message but in this case the keyword is making the error more confusing and less human readable.

Let me know if there is something I'm missing.

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