spumko/joi — pull request #385 by danielb2 (2014-07-23 23:21:34+00:00)
Title: Path for array includes to contain key

Current behavior for an array including an object leaves the `path` without a key in the object.

A message will read correctly: `"message: 'x position 1 fails because x must be a number"`
While the corresponding path is: `"x.1"`
This fix changes the path to read: `"x.1.x"` which then also matches the error message.

This also matches the array behavior with how objects handle the same; where the final key is referenced that has the error occurring.

__Assumptions__: There will only be one reason so the error will be the first in the array (hence `context.reason.0`) . I couldn't find any case where it would be anything else.