-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Allow treating arrays as objects #659
Comments
I'd be open to a PR implementing |
That would work for me. |
closes hapijs#659 Update README.md Update README.md Update README.md Update README.md removed LF on lib/array.js added reassignment of value if valid added abortEarly case fix lint for else keyword always continue if valid or not for #ordered added strip() for array ordered() removed text used for test -grep Fixed error when strip is not the last one in items. Update README.md remove trailing spaces putting w into loop parameters
@pluma mind having a look at the linked PR since you're the one asking ? |
👍 Thanks. |
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions. |
I know there are no plans to support having
joi.array()
apply different schemas to items at different indexes, but it would be very useful to be able to circumvent that by simply treating arrays as objects (like JS generally does already).Example:
joi.object().type(Array).validate([])
Expected outcome: validation passes
Actual outcome: validation fails with "must be an object".
The text was updated successfully, but these errors were encountered: