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

Does not support Joi's array().has(...) #156

Open
jacobwaller opened this issue Jun 7, 2022 · 0 comments
Open

Does not support Joi's array().has(...) #156

jacobwaller opened this issue Jun 7, 2022 · 0 comments

Comments

@jacobwaller
Copy link

jacobwaller commented Jun 7, 2022

Context

  • node version: 16.1.0
  • felicity version: 6.0.0
  • environment (node, browser): node
  • any relevant modules used with (hapi, hoek, etc.): Joi 17.4.1
  • any other relevant information:

To Reproduce
Attempt to create an example of:

Joi.object({
  foo: Joi.array()
            .items(
                    Joi.object().length(1)
             ).has( 
                    { bar: Joi.string() } 
             ),
});

Expected behavior
I would expect an example object to look something like:

{
  foo: [{ bar: "dshkf" }]
}

since Joi should require at least one object in my array matching the validation in .has()

Observed behavior

{
  foo: [{ hsdkj: "hfkdsj" }]
}
@jacobwaller jacobwaller closed this as not planned Won't fix, can't repro, duplicate, stale Jun 7, 2022
@jacobwaller jacobwaller reopened this Jun 7, 2022
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