{"action":"created","comment":{"url":"https://api.github.com/repos/ruby-grape/grape/pulls/comments/42283543","id":42283543,"diff_hunk":"@@ -0,0 +1,52 @@\n+module Grape\n+  module Validations\n+    class Autoload\n+      DEFAULT_PATH = %w(api validators)","path":"lib/grape/validations/autoload.rb","position":4,"original_position":4,"commit_id":"5b8fbef57725a8fef4b7af35c803efae1f24b2fa","original_commit_id":"5b8fbef57725a8fef4b7af35c803efae1f24b2fa","user":{"login":"dblock","id":542335,"avatar_url":"https://avatars.githubusercontent.com/u/542335?v=3","gravatar_id":"","url":"https://api.github.com/users/dblock","html_url":"https://github.com/dblock","followers_url":"https://api.github.com/users/dblock/followers","following_url":"https://api.github.com/users/dblock/following{/other_user}","gists_url":"https://api.github.com/users/dblock/gists{/gist_id}","starred_url":"https://api.github.com/users/dblock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dblock/subscriptions","organizations_url":"https://api.github.com/users/dblock/orgs","repos_url":"https://api.github.com/users/dblock/repos","events_url":"https://api.github.com/users/dblock/events{/privacy}","received_events_url":"https://api.github.com/users/dblock/received_events","type":"User","site_admin":false},"body":"Having a default path `validators` makes sense to me, but `api` feels too specific.","created_at":"2015-10-16T19:58:32Z","updated_at":"2015-10-16T19:58:32Z","html_url":"https://github.com/ruby-grape/grape/pull/1186#discussion_r42283543","pull_request_url":"https://api.github.com/repos/ruby-grape/grape/pulls/1186","_links":{"self":{"href":"https://api.github.com/repos/ruby-grape/grape/pulls/comments/42283543"},"html":{"href":"https://github.com/ruby-grape/grape/pull/1186#discussion_r42283543"},"pull_request":{"href":"https://api.github.com/repos/ruby-grape/grape/pulls/1186"}}},"pull_request":{"url":"https://api.github.com/repos/ruby-grape/grape/pulls/1186","id":47949132,"html_url":"https://github.com/ruby-grape/grape/pull/1186","diff_url":"https://github.com/ruby-grape/grape/pull/1186.diff","patch_url":"https://github.com/ruby-grape/grape/pull/1186.patch","issue_url":"https://api.github.com/repos/ruby-grape/grape/issues/1186","number":1186,"state":"open","locked":false,"title":"add possibility to automatically load user-defined validators(a.k.a custom)","user":{"login":"dm1try","id":486807,"avatar_url":"https://avatars.githubusercontent.com/u/486807?v=3","gravatar_id":"","url":"https://api.github.com/users/dm1try","html_url":"https://github.com/dm1try","followers_url":"https://api.github.com/users/dm1try/followers","following_url":"https://api.github.com/users/dm1try/following{/other_user}","gists_url":"https://api.github.com/users/dm1try/gists{/gist_id}","starred_url":"https://api.github.com/users/dm1try/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dm1try/subscriptions","organizations_url":"https://api.github.com/users/dm1try/orgs","repos_url":"https://api.github.com/users/dm1try/repos","events_url":"https://api.github.com/users/dm1try/events{/privacy}","received_events_url":"https://api.github.com/users/dm1try/received_events","type":"User","site_admin":false},"body":"the solution relies on ActiveSupport::Dependencies, so it works for Grape app mounted on Rails by default.\r\n\r\n```bash\r\n --app\r\n   --controllers\r\n     --api\r\n       --validators\r\n         custom.rb\r\n```\r\n```ruby\r\nparams do\r\n   requires :my_param, custom: true\r\nend\r\n```\r\non the dev enviroment the code of custom validator is refreshed as any other dependency\r\n\r\n\"proof-of-concept\" that we discussed in #1178","created_at":"2015-10-16T19:16:41Z","updated_at":"2015-10-16T19:58:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c0393779bac051c8d16e363528efcbbb88b4324a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ruby-grape/grape/pulls/1186/commits","review_comments_url":"https://api.github.com/repos/ruby-grape/grape/pulls/1186/comments","review_comment_url":"https://api.github.com/repos/ruby-grape/grape/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ruby-grape/grape/issues/1186/comments","statuses_url":"https://api.github.com/repos/ruby-grape/grape/statuses/5b8fbef57725a8fef4b7af35c803efae1f24b2fa","head":{"label":"dm1try:custom_validators_autoload","ref":"custom_validators_autoload","sha":"5b8fbef57725a8fef4b7af35c803efae1f24b2fa","user":{"login":"dm1try","id":486807,"avatar_url":"https://avatars.githubusercontent.com/u/486807?v=3","gravatar_id":"","url":"https://api.github.com/users/dm1try","html_url":"https://github.com/dm1try","followers_url":"https://api.github.com/users/dm1try/followers","following_url":"https://api.github.com/users/dm1try/following{/other_user}","gists_url":"https://api.github.com/users/dm1try/gists{/gist_id}","starred_url":"https://api.github.com/users/dm1try/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dm1try/subscriptions","organizations_url":"https://api.github.com/users/dm1try/orgs","repos_url":"https://api.github.com/users/dm1try/repos","events_url":"https://api.github.com/users/dm1try/events{/privacy}","received_events_url":"https://api.github.com/users/dm1try/received_events","type":"User","site_admin":false},"repo":{"id":18232990,"name":"grape","full_name":"dm1try/grape","owner":{"login":"dm1try","id":486807,"avatar_url":"https://avatars.githubusercontent.com/u/486807?v=3","gravatar_id":"","url":"https://api.github.com/users/dm1try","html_url":"https://github.com/dm1try","followers_url":"https://api.github.com/users/dm1try/followers","following_url":"https://api.github.com/users/dm1try/following{/other_user}","gists_url":"https://api.github.com/users/dm1try/gists{/gist_id}","starred_url":"https://api.github.com/users/dm1try/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dm1try/subscriptions","organizations_url":"https://api.github.com/users/dm1try/orgs","repos_url":"https://api.github.com/users/dm1try/repos","events_url":"https://api.github.com/users/dm1try/events{/privacy}","received_events_url":"https://api.github.com/users/dm1try/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dm1try/grape","description":"An opinionated micro-framework for creating REST-like APIs in Ruby.","fork":true,"url":"https://api.github.com/repos/dm1try/grape","forks_url":"https://api.github.com/repos/dm1try/grape/forks","keys_url":"https://api.github.com/repos/dm1try/grape/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dm1try/grape/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dm1try/grape/teams","hooks_url":"https://api.github.com/repos/dm1try/grape/hooks","issue_events_url":"https://api.github.com/repos/dm1try/grape/issues/events{/number}","events_url":"https://api.github.com/repos/dm1try/grape/events","assignees_url":"https://api.github.com/repos/dm1try/grape/assignees{/user}","branches_url":"https://api.github.com/repos/dm1try/grape/branches{/branch}","tags_url":"https://api.github.com/repos/dm1try/grape/tags","blobs_url":"https://api.github.com/repos/dm1try/grape/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dm1try/grape/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dm1try/grape/git/refs{/sha}","trees_url":"https://api.github.com/repos/dm1try/grape/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dm1try/grape/statuses/{sha}","languages_url":"https://api.github.com/repos/dm1try/grape/languages","stargazers_url":"https://api.github.com/repos/dm1try/grape/stargazers","contributors_url":"https://api.github.com/repos/dm1try/grape/contributors","subscribers_url":"https://api.github.com/repos/dm1try/grape/subscribers","subscription_url":"https://api.github.com/repos/dm1try/grape/subscription","commits_url":"https://api.github.com/repos/dm1try/grape/commits{/sha}","git_commits_url":"https://api.github.com/repos/dm1try/grape/git/commits{/sha}","comments_url":"https://api.github.com/repos/dm1try/grape/comments{/number}","issue_comment_url":"https://api.github.com/repos/dm1try/grape/issues/comments{/number}","contents_url":"https://api.github.com/repos/dm1try/grape/contents/{+path}","compare_url":"https://api.github.com/repos/dm1try/grape/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dm1try/grape/merges","archive_url":"https://api.github.com/repos/dm1try/grape/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dm1try/grape/downloads","issues_url":"https://api.github.com/repos/dm1try/grape/issues{/number}","pulls_url":"https://api.github.com/repos/dm1try/grape/pulls{/number}","milestones_url":"https://api.github.com/repos/dm1try/grape/milestones{/number}","notifications_url":"https://api.github.com/repos/dm1try/grape/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dm1try/grape/labels{/name}","releases_url":"https://api.github.com/repos/dm1try/grape/releases{/id}","created_at":"2014-03-29T02:54:51Z","updated_at":"2015-08-03T17:53:45Z","pushed_at":"2015-10-16T18:50:15Z","git_url":"git://github.com/dm1try/grape.git","ssh_url":"git@github.com:dm1try/grape.git","clone_url":"https://github.com/dm1try/grape.git","svn_url":"https://github.com/dm1try/grape","homepage":"http://intridea.github.io/grape","size":6528,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ruby-grape:master","ref":"master","sha":"9c8713d6aa9d015c0501081d18f736012ca71006","user":{"login":"ruby-grape","id":13624553,"avatar_url":"https://avatars.githubusercontent.com/u/13624553?v=3","gravatar_id":"","url":"https://api.github.com/users/ruby-grape","html_url":"https://github.com/ruby-grape","followers_url":"https://api.github.com/users/ruby-grape/followers","following_url":"https://api.github.com/users/ruby-grape/following{/other_user}","gists_url":"https://api.github.com/users/ruby-grape/gists{/gist_id}","starred_url":"https://api.github.com/users/ruby-grape/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruby-grape/subscriptions","organizations_url":"https://api.github.com/users/ruby-grape/orgs","repos_url":"https://api.github.com/users/ruby-grape/repos","events_url":"https://api.github.com/users/ruby-grape/events{/privacy}","received_events_url":"https://api.github.com/users/ruby-grape/received_events","type":"Organization","site_admin":false},"repo":{"id":812393,"name":"grape","full_name":"ruby-grape/grape","owner":{"login":"ruby-grape","id":13624553,"avatar_url":"https://avatars.githubusercontent.com/u/13624553?v=3","gravatar_id":"","url":"https://api.github.com/users/ruby-grape","html_url":"https://github.com/ruby-grape","followers_url":"https://api.github.com/users/ruby-grape/followers","following_url":"https://api.github.com/users/ruby-grape/following{/other_user}","gists_url":"https://api.github.com/users/ruby-grape/gists{/gist_id}","starred_url":"https://api.github.com/users/ruby-grape/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruby-grape/subscriptions","organizations_url":"https://api.github.com/users/ruby-grape/orgs","repos_url":"https://api.github.com/users/ruby-grape/repos","events_url":"https://api.github.com/users/ruby-grape/events{/privacy}","received_events_url":"https://api.github.com/users/ruby-grape/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ruby-grape/grape","description":"An opinionated micro-framework for creating REST-like APIs in Ruby.","fork":false,"url":"https://api.github.com/repos/ruby-grape/grape","forks_url":"https://api.github.com/repos/ruby-grape/grape/forks","keys_url":"https://api.github.com/repos/ruby-grape/grape/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ruby-grape/grape/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ruby-grape/grape/teams","hooks_url":"https://api.github.com/repos/ruby-grape/grape/hooks","issue_events_url":"https://api.github.com/repos/ruby-grape/grape/issues/events{/number}","events_url":"https://api.github.com/repos/ruby-grape/grape/events","assignees_url":"https://api.github.com/repos/ruby-grape/grape/assignees{/user}","branches_url":"https://api.github.com/repos/ruby-grape/grape/branches{/branch}","tags_url":"https://api.github.com/repos/ruby-grape/grape/tags","blobs_url":"https://api.github.com/repos/ruby-grape/grape/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ruby-grape/grape/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ruby-grape/grape/git/refs{/sha}","trees_url":"https://api.github.com/repos/ruby-grape/grape/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ruby-grape/grape/statuses/{sha}","languages_url":"https://api.github.com/repos/ruby-grape/grape/languages","stargazers_url":"https://api.github.com/repos/ruby-grape/grape/stargazers","contributors_url":"https://api.github.com/repos/ruby-grape/grape/contributors","subscribers_url":"https://api.github.com/repos/ruby-grape/grape/subscribers","subscription_url":"https://api.github.com/repos/ruby-grape/grape/subscription","commits_url":"https://api.github.com/repos/ruby-grape/grape/commits{/sha}","git_commits_url":"https://api.github.com/repos/ruby-grape/grape/git/commits{/sha}","comments_url":"https://api.github.com/repos/ruby-grape/grape/comments{/number}","issue_comment_url":"https://api.github.com/repos/ruby-grape/grape/issues/comments{/number}","contents_url":"https://api.github.com/repos/ruby-grape/grape/contents/{+path}","compare_url":"https://api.github.com/repos/ruby-grape/grape/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ruby-grape/grape/merges","archive_url":"https://api.github.com/repos/ruby-grape/grape/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ruby-grape/grape/downloads","issues_url":"https://api.github.com/repos/ruby-grape/grape/issues{/number}","pulls_url":"https://api.github.com/repos/ruby-grape/grape/pulls{/number}","milestones_url":"https://api.github.com/repos/ruby-grape/grape/milestones{/number}","notifications_url":"https://api.github.com/repos/ruby-grape/grape/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ruby-grape/grape/labels{/name}","releases_url":"https://api.github.com/repos/ruby-grape/grape/releases{/id}","created_at":"2010-08-02T14:25:08Z","updated_at":"2015-10-16T19:09:44Z","pushed_at":"2015-10-16T19:16:41Z","git_url":"git://github.com/ruby-grape/grape.git","ssh_url":"git@github.com:ruby-grape/grape.git","clone_url":"https://github.com/ruby-grape/grape.git","svn_url":"https://github.com/ruby-grape/grape","homepage":"https://ruby-grape.github.io","size":12652,"stargazers_count":6709,"watchers_count":6709,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":766,"mirror_url":null,"open_issues_count":107,"forks":766,"open_issues":107,"watchers":6709,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ruby-grape/grape/pulls/1186"},"html":{"href":"https://github.com/ruby-grape/grape/pull/1186"},"issue":{"href":"https://api.github.com/repos/ruby-grape/grape/issues/1186"},"comments":{"href":"https://api.github.com/repos/ruby-grape/grape/issues/1186/comments"},"review_comments":{"href":"https://api.github.com/repos/ruby-grape/grape/pulls/1186/comments"},"review_comment":{"href":"https://api.github.com/repos/ruby-grape/grape/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ruby-grape/grape/pulls/1186/commits"},"statuses":{"href":"https://api.github.com/repos/ruby-grape/grape/statuses/5b8fbef57725a8fef4b7af35c803efae1f24b2fa"}}}}