{"action":"created","issue":{"url":"https://api.github.com/repos/hapijs/joi/issues/675","labels_url":"https://api.github.com/repos/hapijs/joi/issues/675/labels{/name}","comments_url":"https://api.github.com/repos/hapijs/joi/issues/675/comments","events_url":"https://api.github.com/repos/hapijs/joi/issues/675/events","html_url":"https://github.com/hapijs/joi/issues/675","id":90287607,"number":675,"title":"Requiring n of m rules to be satisfied","user":{"login":"chrisegner","id":1007176,"avatar_url":"https://avatars.githubusercontent.com/u/1007176?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisegner","html_url":"https://github.com/chrisegner","followers_url":"https://api.github.com/users/chrisegner/followers","following_url":"https://api.github.com/users/chrisegner/following{/other_user}","gists_url":"https://api.github.com/users/chrisegner/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisegner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisegner/subscriptions","organizations_url":"https://api.github.com/users/chrisegner/orgs","repos_url":"https://api.github.com/users/chrisegner/repos","events_url":"https://api.github.com/users/chrisegner/events{/privacy}","received_events_url":"https://api.github.com/users/chrisegner/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hapijs/joi/labels/question","name":"question","color":"d4c5f9"}],"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},"milestone":null,"comments":3,"created_at":"2015-06-23T04:52:38Z","updated_at":"2015-06-24T21:43:03Z","closed_at":null,"body":"I'm new to Joi, but it comes highly recommended from a friend.  I'm having a little trouble figuring out how to translate this into joi.\r\n\r\nWe would like to enforce a password policy that, in addition to length, requires the user to have at least three of the four following character classes:\r\n- lower case letter\r\n- upper case letter\r\n- number\r\n- symbol (list of characters specified, preferably by regex)\r\n\r\nAlternatively, I have a function that performs the validation already, but I don't know how to use it to extend the validators already provided.  Is that an option?  I can always hack something into place, but I'd prefer to stay within the API if at all possible."},"comment":{"url":"https://api.github.com/repos/hapijs/joi/issues/comments/115020483","html_url":"https://github.com/hapijs/joi/issues/675#issuecomment-115020483","issue_url":"https://api.github.com/repos/hapijs/joi/issues/675","id":115020483,"user":{"login":"chrisegner","id":1007176,"avatar_url":"https://avatars.githubusercontent.com/u/1007176?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisegner","html_url":"https://github.com/chrisegner","followers_url":"https://api.github.com/users/chrisegner/followers","following_url":"https://api.github.com/users/chrisegner/following{/other_user}","gists_url":"https://api.github.com/users/chrisegner/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisegner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisegner/subscriptions","organizations_url":"https://api.github.com/users/chrisegner/orgs","repos_url":"https://api.github.com/users/chrisegner/repos","events_url":"https://api.github.com/users/chrisegner/events{/privacy}","received_events_url":"https://api.github.com/users/chrisegner/received_events","type":"User","site_admin":false},"created_at":"2015-06-24T21:43:03Z","updated_at":"2015-06-24T21:43:03Z","body":"The more I try to bring Joi into our stack, the more I see having some way to create custom validators as critical.  For now, I think we have to drive validation ourselves with different validator types, one of which is Joi.  I would much rather be able to pull something off the shelf that's been tested and vetted by lots of peoples' circumstances.\r\n\r\nSecondly, I see custom validators as being a great way to add a contrib portion of the project.  It would be awesome to have best of breed validators for many different circumstances just handily available.  Need to validate a ISO timestamp?  How about an Olsen DB timezone name?  How about an ISO-3166-2/3 country code?  Phone number by locale?  These would all be incredibly useful, but there doesn't seem to be a natural way for them to be integrated into the project.\r\n\r\nThoughts?"}}