{"action":"created","issue":{"url":"https://api.github.com/repos/hapijs/joi/issues/1450","repository_url":"https://api.github.com/repos/hapijs/joi","labels_url":"https://api.github.com/repos/hapijs/joi/issues/1450/labels{/name}","comments_url":"https://api.github.com/repos/hapijs/joi/issues/1450/comments","events_url":"https://api.github.com/repos/hapijs/joi/issues/1450/events","html_url":"https://github.com/hapijs/joi/issues/1450","id":303382146,"number":1450,"title":"Create a custom validator rule","user":{"login":"aroybase","id":1997003,"avatar_url":"https://avatars3.githubusercontent.com/u/1997003?v=4","gravatar_id":"","url":"https://api.github.com/users/aroybase","html_url":"https://github.com/aroybase","followers_url":"https://api.github.com/users/aroybase/followers","following_url":"https://api.github.com/users/aroybase/following{/other_user}","gists_url":"https://api.github.com/users/aroybase/gists{/gist_id}","starred_url":"https://api.github.com/users/aroybase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aroybase/subscriptions","organizations_url":"https://api.github.com/users/aroybase/orgs","repos_url":"https://api.github.com/users/aroybase/repos","events_url":"https://api.github.com/users/aroybase/events{/privacy}","received_events_url":"https://api.github.com/users/aroybase/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-03-08T07:28:58Z","updated_at":"2018-03-08T07:55:26Z","closed_at":null,"author_association":"NONE","body":"#### Context\r\n\r\n* *node version*: 9.2.0\r\n* *joi version*: 12.0.0\r\n* *environment* (node, browser): TypeScript, Express\r\n* *used with* (hapi, standalone, ...): standalone\r\n* *any other relevant information*:\r\n\r\n#### What are you trying to achieve or the steps to reproduce ?\r\nHi guys,\r\n\r\nI'm wondering if i can create a custom validation rule.  \r\nI currently have this schema : \r\n```\r\nconst schema = Joi.object().keys({\r\n    businessName: Joi.string().required(),\r\n    slug: Joi.string().regex(SLUG).required(),\r\n    description: Joi.string().required(),\r\n}).required();\r\n```\r\n\r\nAnd i want to had another rule to my slug for it to be uniq by checking in my DB, so i would like to have something like  :  \r\n\r\n```\r\nconst schema = Joi.object().keys({\r\n    businessName: Joi.string().required(),\r\n    slug: Joi.string().regex(SLUG).isSlugUniq().required(),\r\n    description: Joi.string().required(),\r\n}).required();\r\n```\r\n\r\nDo you know if i can do this ? Can you tell me how ? (I did not find anything about this on issues list )\r\n\r\nThank you\r\n\r\n\r\nEDIT : Ok i filtered my issue with `not closed`. I found this : https://gist.github.com/Marsup/14597d0c8eaa10c4addb and currently reading. My issue is on stand-by. I'll close it if this answers my question."},"comment":{"url":"https://api.github.com/repos/hapijs/joi/issues/comments/371408824","html_url":"https://github.com/hapijs/joi/issues/1450#issuecomment-371408824","issue_url":"https://api.github.com/repos/hapijs/joi/issues/1450","id":371408824,"user":{"login":"aroybase","id":1997003,"avatar_url":"https://avatars3.githubusercontent.com/u/1997003?v=4","gravatar_id":"","url":"https://api.github.com/users/aroybase","html_url":"https://github.com/aroybase","followers_url":"https://api.github.com/users/aroybase/followers","following_url":"https://api.github.com/users/aroybase/following{/other_user}","gists_url":"https://api.github.com/users/aroybase/gists{/gist_id}","starred_url":"https://api.github.com/users/aroybase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aroybase/subscriptions","organizations_url":"https://api.github.com/users/aroybase/orgs","repos_url":"https://api.github.com/users/aroybase/repos","events_url":"https://api.github.com/users/aroybase/events{/privacy}","received_events_url":"https://api.github.com/users/aroybase/received_events","type":"User","site_admin":false},"created_at":"2018-03-08T07:55:26Z","updated_at":"2018-03-08T07:55:26Z","author_association":"NONE","body":"Ah ! But [this article](https://gist.github.com/Marsup/14597d0c8eaa10c4addb) for Joi 7.0.0 seems to indicates otherwise."}}
{"actor":{"display_login":"aroybase"}}