{"action":"created","issue":{"url":"https://api.github.com/repos/hapijs/joi/issues/1050","repository_url":"https://api.github.com/repos/hapijs/joi","labels_url":"https://api.github.com/repos/hapijs/joi/issues/1050/labels{/name}","comments_url":"https://api.github.com/repos/hapijs/joi/issues/1050/comments","events_url":"https://api.github.com/repos/hapijs/joi/issues/1050/events","html_url":"https://github.com/hapijs/joi/issues/1050","id":192070193,"number":1050,"title":"Joi.reach() cannot reach into an array schema","user":{"login":"cdhowie","id":354641,"avatar_url":"https://avatars.githubusercontent.com/u/354641?v=3","gravatar_id":"","url":"https://api.github.com/users/cdhowie","html_url":"https://github.com/cdhowie","followers_url":"https://api.github.com/users/cdhowie/followers","following_url":"https://api.github.com/users/cdhowie/following{/other_user}","gists_url":"https://api.github.com/users/cdhowie/gists{/gist_id}","starred_url":"https://api.github.com/users/cdhowie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdhowie/subscriptions","organizations_url":"https://api.github.com/users/cdhowie/orgs","repos_url":"https://api.github.com/users/cdhowie/repos","events_url":"https://api.github.com/users/cdhowie/events{/privacy}","received_events_url":"https://api.github.com/users/cdhowie/received_events","type":"User","site_admin":false},"labels":[{"id":24848524,"url":"https://api.github.com/repos/hapijs/joi/labels/request","name":"request","color":"c7def8","default":false}],"state":"open","locked":false,"assignee":{"login":"Marsup","id":796194,"avatar_url":"https://avatars.githubusercontent.com/u/796194?v=3","gravatar_id":"","url":"https://api.github.com/users/Marsup","html_url":"https://github.com/Marsup","followers_url":"https://api.github.com/users/Marsup/followers","following_url":"https://api.github.com/users/Marsup/following{/other_user}","gists_url":"https://api.github.com/users/Marsup/gists{/gist_id}","starred_url":"https://api.github.com/users/Marsup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Marsup/subscriptions","organizations_url":"https://api.github.com/users/Marsup/orgs","repos_url":"https://api.github.com/users/Marsup/repos","events_url":"https://api.github.com/users/Marsup/events{/privacy}","received_events_url":"https://api.github.com/users/Marsup/received_events","type":"User","site_admin":false},"assignees":[{"login":"Marsup","id":796194,"avatar_url":"https://avatars.githubusercontent.com/u/796194?v=3","gravatar_id":"","url":"https://api.github.com/users/Marsup","html_url":"https://github.com/Marsup","followers_url":"https://api.github.com/users/Marsup/followers","following_url":"https://api.github.com/users/Marsup/following{/other_user}","gists_url":"https://api.github.com/users/Marsup/gists{/gist_id}","starred_url":"https://api.github.com/users/Marsup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Marsup/subscriptions","organizations_url":"https://api.github.com/users/Marsup/orgs","repos_url":"https://api.github.com/users/Marsup/repos","events_url":"https://api.github.com/users/Marsup/events{/privacy}","received_events_url":"https://api.github.com/users/Marsup/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2016-11-28T17:42:04Z","updated_at":"2016-12-01T16:26:29Z","closed_at":null,"body":"`Joi.reach()` is unable to reach into or beyond any array schema items.  (Looking at the source code, it uses `schema._inner.children`, which is not set on array schemas.)\r\n\r\nIt would be helpful if this were possible in cases where an object schema has an attribute that allows array-of-object.\r\n\r\n```js\r\nconst schema = Joi.object().keys({\r\n    items: Joi.array().items(\r\n        Joi.object().keys({\r\n            name: Joi.string()\r\n        })\r\n    )\r\n});\r\n```\r\n\r\nFor example, `Joi.reach(schema, 'items.0')` could return the entire inner object schema, and `Joi.reach(schema, 'items.0.name')` could return the schema for the inner name key."},"comment":{"url":"https://api.github.com/repos/hapijs/joi/issues/comments/264219950","html_url":"https://github.com/hapijs/joi/issues/1050#issuecomment-264219950","issue_url":"https://api.github.com/repos/hapijs/joi/issues/1050","id":264219950,"user":{"login":"cdhowie","id":354641,"avatar_url":"https://avatars.githubusercontent.com/u/354641?v=3","gravatar_id":"","url":"https://api.github.com/users/cdhowie","html_url":"https://github.com/cdhowie","followers_url":"https://api.github.com/users/cdhowie/followers","following_url":"https://api.github.com/users/cdhowie/following{/other_user}","gists_url":"https://api.github.com/users/cdhowie/gists{/gist_id}","starred_url":"https://api.github.com/users/cdhowie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdhowie/subscriptions","organizations_url":"https://api.github.com/users/cdhowie/orgs","repos_url":"https://api.github.com/users/cdhowie/repos","events_url":"https://api.github.com/users/cdhowie/events{/privacy}","received_events_url":"https://api.github.com/users/cdhowie/received_events","type":"User","site_admin":false},"created_at":"2016-12-01T16:26:29Z","updated_at":"2016-12-01T16:26:29Z","body":"I'm not against that particular idea, though conceptually it seems like the data model should be the authoritative source.  Perhaps it's just me, but having a third file declare just the common pieces to both schemas actually feels _more_ confusing."}}
{"actor":{"display_login":"cdhowie"}}