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

Giving an array argument to any.valid returns incorrect error #2254

Closed
nclsndr opened this issue Dec 24, 2019 · 1 comment
Closed

Giving an array argument to any.valid returns incorrect error #2254

nclsndr opened this issue Dec 24, 2019 · 1 comment
Assignees
Labels
bug Bug or defect
Milestone

Comments

@nclsndr
Copy link

nclsndr commented Dec 24, 2019

Support plan

  • which support plan is this issue covered by?: Community
  • is this issue currently blocking your project?: No
  • is this issue affecting a production system?: No

Context

  • node version: 12.14.0
  • module version with issue: 16.1.8
  • last module version without issue: 14.3.1 (the one I use but not last)
  • environment (e.g. node, browser, native): node
  • used with (e.g. hapi application, another framework, standalone, ...): standalone
  • any other relevant information:

What are you trying to achieve or the steps to reproduce?

const someStringSchema = Joi.string().valid(['someValue'])

What was the result you got?

An error message as expected because of moving from array args to list of args BUT
The error message is wrong: Method no longer accepts array arguments: allow

What result did you expect?

I imagine we want Joi to warn us about the valid method not allow (that had the same issue earlier)
Method no longer accepts array arguments: valid

@nclsndr nclsndr added the support Questions, discussions, and general support label Dec 24, 2019
@hueniverse hueniverse added bug Bug or defect and removed support Questions, discussions, and general support labels Dec 26, 2019
@hueniverse hueniverse self-assigned this Dec 26, 2019
@hueniverse hueniverse added this to the 17.0.0 milestone Dec 26, 2019
@nclsndr
Copy link
Author

nclsndr commented Dec 26, 2019

thx you @hueniverse 🙌

@lock lock bot locked as resolved and limited conversation to collaborators Jun 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Bug or defect
Projects
None yet
Development

No branches or pull requests

2 participants