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

Refactors Joi.array() to utilize .items() #84

Merged
merged 2 commits into from Dec 23, 2016
Merged

Refactors Joi.array() to utilize .items() #84

merged 2 commits into from Dec 23, 2016

Conversation

WesTyler
Copy link
Contributor

@WesTyler WesTyler commented Dec 5, 2016

Joi.array(Joi.object()) does not have any functionality, but does throw an error beginning in Joi v10.0.3.

This PR refactors to utilize Joi.array().items(Joi.object()) to allow for the upgrade to Joi v10.0.3+ and Hapi v16.x

Closes #83

@WesTyler WesTyler mentioned this pull request Dec 5, 2016
@AdriVanHoudt
Copy link
Contributor

Good catch! Isn't there a test to check if it errors when connections is not an array of objects?

@WesTyler
Copy link
Contributor Author

WesTyler commented Dec 6, 2016

Technically no. There are tests on that connections array, but the way the Joi schema was defined it was accepting any array. I'll add a unit test to this PR.

@WesTyler WesTyler mentioned this pull request Dec 6, 2016
@AdriVanHoudt
Copy link
Contributor

Nice lgtm!

@csrl csrl merged commit b5f1d10 into hapijs:master Dec 23, 2016
@csrl csrl self-assigned this Dec 23, 2016
@csrl csrl added this to the 4.1.0 milestone Dec 23, 2016
@csrl csrl added the bug Bug or defect label Dec 23, 2016
@lock
Copy link

lock bot commented Jan 9, 2020

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.

@lock lock bot unassigned csrl Jan 9, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 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

Successfully merging this pull request may close these issues.

Joi.array() does not accept arguments
3 participants