hapijs / glue

Server composer for hapi.js
Other
245 stars 62 forks source link

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

Closed WesTyler closed 7 years ago

WesTyler commented 7 years ago

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

AdriVanHoudt commented 7 years ago

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

WesTyler commented 7 years ago

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.

AdriVanHoudt commented 7 years ago

Nice lgtm!

lock[bot] commented 4 years ago

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.