{"action":"closed","issue":{"url":"https://api.github.com/repos/hapijs/joi/issues/901","repository_url":"https://api.github.com/repos/hapijs/joi","labels_url":"https://api.github.com/repos/hapijs/joi/issues/901/labels{/name}","comments_url":"https://api.github.com/repos/hapijs/joi/issues/901/comments","events_url":"https://api.github.com/repos/hapijs/joi/issues/901/events","html_url":"https://github.com/hapijs/joi/issues/901","id":156624411,"number":901,"title":"Proposal: Support schemas in any.invalid","user":{"login":"elyobo","id":407806,"avatar_url":"https://avatars.githubusercontent.com/u/407806?v=3","gravatar_id":"","url":"https://api.github.com/users/elyobo","html_url":"https://github.com/elyobo","followers_url":"https://api.github.com/users/elyobo/followers","following_url":"https://api.github.com/users/elyobo/following{/other_user}","gists_url":"https://api.github.com/users/elyobo/gists{/gist_id}","starred_url":"https://api.github.com/users/elyobo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elyobo/subscriptions","organizations_url":"https://api.github.com/users/elyobo/orgs","repos_url":"https://api.github.com/users/elyobo/repos","events_url":"https://api.github.com/users/elyobo/events{/privacy}","received_events_url":"https://api.github.com/users/elyobo/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-05-24T22:31:15Z","updated_at":"2016-05-28T11:43:51Z","closed_at":"2016-05-28T11:43:51Z","body":"`any.invalid` is useful for defining exact values which are invalid, but it would be more flexible if you could define flexible values which should be rejected.  Permitting regular expressions would work well for string types, but supporting Joi schemas would allow even further flexibility (and also cover the regex case).\r\n\r\n```\r\nconst bad = Joi.string().regex(/badcontent/);\r\nconst schema = Joi.any().invalid(bad);\r\n\r\n// No errors\r\nJoi.validate('all good', schema);\r\n\r\n// Errors\r\nJoi.validate('badcontent', schema).\r\n```"}}
{"actor":{"display_login":"Marsup"}}