{"action":"opened","number":38,"pull_request":{"url":"https://api.github.com/repos/gangverk/flask-swagger/pulls/38","id":93781896,"html_url":"https://github.com/gangverk/flask-swagger/pull/38","diff_url":"https://github.com/gangverk/flask-swagger/pull/38.diff","patch_url":"https://github.com/gangverk/flask-swagger/pull/38.patch","issue_url":"https://api.github.com/repos/gangverk/flask-swagger/issues/38","number":38,"state":"open","locked":false,"title":"Don't assume method verbs are View functions","user":{"login":"jamesboehmer","id":750457,"avatar_url":"https://avatars.githubusercontent.com/u/750457?v=3","gravatar_id":"","url":"https://api.github.com/users/jamesboehmer","html_url":"https://github.com/jamesboehmer","followers_url":"https://api.github.com/users/jamesboehmer/followers","following_url":"https://api.github.com/users/jamesboehmer/following{/other_user}","gists_url":"https://api.github.com/users/jamesboehmer/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesboehmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesboehmer/subscriptions","organizations_url":"https://api.github.com/users/jamesboehmer/orgs","repos_url":"https://api.github.com/users/jamesboehmer/repos","events_url":"https://api.github.com/users/jamesboehmer/events{/privacy}","received_events_url":"https://api.github.com/users/jamesboehmer/received_events","type":"User","site_admin":false},"body":"When iterating through the app's endpoints, we're assuming the View instance has methods named `get`, `post`, etc for each verb in in `View`'s `methods = ['GET', 'POST']` attribute.  However this is not a requirement for implementations of `flask.views.View`.\r\n\r\nFor example, if I added a url rule with:\r\n```\r\napp.add_url_rule('/someview', view_func=SomeView.as_view('some_view', **kwargs))\r\n```\r\nthe `SomeView` class is obligated to have a declaration of `methods = [...]`, but not functions named `get`, `post`, `put`, `delete`, or anything which appears in the list.  Flask swagger is assuming those functions exist in the view, and crashes on startup when it tries to access them.  This changes checks for their existence before accessing them.","created_at":"2016-11-15T15:04:06Z","updated_at":"2016-11-15T15:04:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/gangverk/flask-swagger/pulls/38/commits","review_comments_url":"https://api.github.com/repos/gangverk/flask-swagger/pulls/38/comments","review_comment_url":"https://api.github.com/repos/gangverk/flask-swagger/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gangverk/flask-swagger/issues/38/comments","statuses_url":"https://api.github.com/repos/gangverk/flask-swagger/statuses/995620ee8b7dec2aded72e6979ef4a59e53721f5","head":{"label":"jamesboehmer:master","ref":"master","sha":"995620ee8b7dec2aded72e6979ef4a59e53721f5","user":{"login":"jamesboehmer","id":750457,"avatar_url":"https://avatars.githubusercontent.com/u/750457?v=3","gravatar_id":"","url":"https://api.github.com/users/jamesboehmer","html_url":"https://github.com/jamesboehmer","followers_url":"https://api.github.com/users/jamesboehmer/followers","following_url":"https://api.github.com/users/jamesboehmer/following{/other_user}","gists_url":"https://api.github.com/users/jamesboehmer/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesboehmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesboehmer/subscriptions","organizations_url":"https://api.github.com/users/jamesboehmer/orgs","repos_url":"https://api.github.com/users/jamesboehmer/repos","events_url":"https://api.github.com/users/jamesboehmer/events{/privacy}","received_events_url":"https://api.github.com/users/jamesboehmer/received_events","type":"User","site_admin":false},"repo":{"id":73737762,"name":"flask-swagger","full_name":"jamesboehmer/flask-swagger","owner":{"login":"jamesboehmer","id":750457,"avatar_url":"https://avatars.githubusercontent.com/u/750457?v=3","gravatar_id":"","url":"https://api.github.com/users/jamesboehmer","html_url":"https://github.com/jamesboehmer","followers_url":"https://api.github.com/users/jamesboehmer/followers","following_url":"https://api.github.com/users/jamesboehmer/following{/other_user}","gists_url":"https://api.github.com/users/jamesboehmer/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesboehmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesboehmer/subscriptions","organizations_url":"https://api.github.com/users/jamesboehmer/orgs","repos_url":"https://api.github.com/users/jamesboehmer/repos","events_url":"https://api.github.com/users/jamesboehmer/events{/privacy}","received_events_url":"https://api.github.com/users/jamesboehmer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jamesboehmer/flask-swagger","description":"A swagger 2.0 spec extractor for flask","fork":true,"url":"https://api.github.com/repos/jamesboehmer/flask-swagger","forks_url":"https://api.github.com/repos/jamesboehmer/flask-swagger/forks","keys_url":"https://api.github.com/repos/jamesboehmer/flask-swagger/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jamesboehmer/flask-swagger/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jamesboehmer/flask-swagger/teams","hooks_url":"https://api.github.com/repos/jamesboehmer/flask-swagger/hooks","issue_events_url":"https://api.github.com/repos/jamesboehmer/flask-swagger/issues/events{/number}","events_url":"https://api.github.com/repos/jamesboehmer/flask-swagger/events","assignees_url":"https://api.github.com/repos/jamesboehmer/flask-swagger/assignees{/user}","branches_url":"https://api.github.com/repos/jamesboehmer/flask-swagger/branches{/branch}","tags_url":"https://api.github.com/repos/jamesboehmer/flask-swagger/tags","blobs_url":"https://api.github.com/repos/jamesboehmer/flask-swagger/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jamesboehmer/flask-swagger/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jamesboehmer/flask-swagger/git/refs{/sha}","trees_url":"https://api.github.com/repos/jamesboehmer/flask-swagger/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jamesboehmer/flask-swagger/statuses/{sha}","languages_url":"https://api.github.com/repos/jamesboehmer/flask-swagger/languages","stargazers_url":"https://api.github.com/repos/jamesboehmer/flask-swagger/stargazers","contributors_url":"https://api.github.com/repos/jamesboehmer/flask-swagger/contributors","subscribers_url":"https://api.github.com/repos/jamesboehmer/flask-swagger/subscribers","subscription_url":"https://api.github.com/repos/jamesboehmer/flask-swagger/subscription","commits_url":"https://api.github.com/repos/jamesboehmer/flask-swagger/commits{/sha}","git_commits_url":"https://api.github.com/repos/jamesboehmer/flask-swagger/git/commits{/sha}","comments_url":"https://api.github.com/repos/jamesboehmer/flask-swagger/comments{/number}","issue_comment_url":"https://api.github.com/repos/jamesboehmer/flask-swagger/issues/comments{/number}","contents_url":"https://api.github.com/repos/jamesboehmer/flask-swagger/contents/{+path}","compare_url":"https://api.github.com/repos/jamesboehmer/flask-swagger/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jamesboehmer/flask-swagger/merges","archive_url":"https://api.github.com/repos/jamesboehmer/flask-swagger/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jamesboehmer/flask-swagger/downloads","issues_url":"https://api.github.com/repos/jamesboehmer/flask-swagger/issues{/number}","pulls_url":"https://api.github.com/repos/jamesboehmer/flask-swagger/pulls{/number}","milestones_url":"https://api.github.com/repos/jamesboehmer/flask-swagger/milestones{/number}","notifications_url":"https://api.github.com/repos/jamesboehmer/flask-swagger/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jamesboehmer/flask-swagger/labels{/name}","releases_url":"https://api.github.com/repos/jamesboehmer/flask-swagger/releases{/id}","deployments_url":"https://api.github.com/repos/jamesboehmer/flask-swagger/deployments","created_at":"2016-11-14T19:07:42Z","updated_at":"2016-11-14T19:07:43Z","pushed_at":"2016-11-15T14:53:09Z","git_url":"git://github.com/jamesboehmer/flask-swagger.git","ssh_url":"git@github.com:jamesboehmer/flask-swagger.git","clone_url":"https://github.com/jamesboehmer/flask-swagger.git","svn_url":"https://github.com/jamesboehmer/flask-swagger","homepage":"","size":66,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"gangverk:master","ref":"master","sha":"1ca16eae58bea17847260311b2760285c328a1b9","user":{"login":"gangverk","id":1301121,"avatar_url":"https://avatars.githubusercontent.com/u/1301121?v=3","gravatar_id":"","url":"https://api.github.com/users/gangverk","html_url":"https://github.com/gangverk","followers_url":"https://api.github.com/users/gangverk/followers","following_url":"https://api.github.com/users/gangverk/following{/other_user}","gists_url":"https://api.github.com/users/gangverk/gists{/gist_id}","starred_url":"https://api.github.com/users/gangverk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gangverk/subscriptions","organizations_url":"https://api.github.com/users/gangverk/orgs","repos_url":"https://api.github.com/users/gangverk/repos","events_url":"https://api.github.com/users/gangverk/events{/privacy}","received_events_url":"https://api.github.com/users/gangverk/received_events","type":"Organization","site_admin":false},"repo":{"id":31482659,"name":"flask-swagger","full_name":"gangverk/flask-swagger","owner":{"login":"gangverk","id":1301121,"avatar_url":"https://avatars.githubusercontent.com/u/1301121?v=3","gravatar_id":"","url":"https://api.github.com/users/gangverk","html_url":"https://github.com/gangverk","followers_url":"https://api.github.com/users/gangverk/followers","following_url":"https://api.github.com/users/gangverk/following{/other_user}","gists_url":"https://api.github.com/users/gangverk/gists{/gist_id}","starred_url":"https://api.github.com/users/gangverk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gangverk/subscriptions","organizations_url":"https://api.github.com/users/gangverk/orgs","repos_url":"https://api.github.com/users/gangverk/repos","events_url":"https://api.github.com/users/gangverk/events{/privacy}","received_events_url":"https://api.github.com/users/gangverk/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gangverk/flask-swagger","description":"A swagger 2.0 spec extractor for flask","fork":false,"url":"https://api.github.com/repos/gangverk/flask-swagger","forks_url":"https://api.github.com/repos/gangverk/flask-swagger/forks","keys_url":"https://api.github.com/repos/gangverk/flask-swagger/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gangverk/flask-swagger/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gangverk/flask-swagger/teams","hooks_url":"https://api.github.com/repos/gangverk/flask-swagger/hooks","issue_events_url":"https://api.github.com/repos/gangverk/flask-swagger/issues/events{/number}","events_url":"https://api.github.com/repos/gangverk/flask-swagger/events","assignees_url":"https://api.github.com/repos/gangverk/flask-swagger/assignees{/user}","branches_url":"https://api.github.com/repos/gangverk/flask-swagger/branches{/branch}","tags_url":"https://api.github.com/repos/gangverk/flask-swagger/tags","blobs_url":"https://api.github.com/repos/gangverk/flask-swagger/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gangverk/flask-swagger/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gangverk/flask-swagger/git/refs{/sha}","trees_url":"https://api.github.com/repos/gangverk/flask-swagger/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gangverk/flask-swagger/statuses/{sha}","languages_url":"https://api.github.com/repos/gangverk/flask-swagger/languages","stargazers_url":"https://api.github.com/repos/gangverk/flask-swagger/stargazers","contributors_url":"https://api.github.com/repos/gangverk/flask-swagger/contributors","subscribers_url":"https://api.github.com/repos/gangverk/flask-swagger/subscribers","subscription_url":"https://api.github.com/repos/gangverk/flask-swagger/subscription","commits_url":"https://api.github.com/repos/gangverk/flask-swagger/commits{/sha}","git_commits_url":"https://api.github.com/repos/gangverk/flask-swagger/git/commits{/sha}","comments_url":"https://api.github.com/repos/gangverk/flask-swagger/comments{/number}","issue_comment_url":"https://api.github.com/repos/gangverk/flask-swagger/issues/comments{/number}","contents_url":"https://api.github.com/repos/gangverk/flask-swagger/contents/{+path}","compare_url":"https://api.github.com/repos/gangverk/flask-swagger/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gangverk/flask-swagger/merges","archive_url":"https://api.github.com/repos/gangverk/flask-swagger/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gangverk/flask-swagger/downloads","issues_url":"https://api.github.com/repos/gangverk/flask-swagger/issues{/number}","pulls_url":"https://api.github.com/repos/gangverk/flask-swagger/pulls{/number}","milestones_url":"https://api.github.com/repos/gangverk/flask-swagger/milestones{/number}","notifications_url":"https://api.github.com/repos/gangverk/flask-swagger/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gangverk/flask-swagger/labels{/name}","releases_url":"https://api.github.com/repos/gangverk/flask-swagger/releases{/id}","deployments_url":"https://api.github.com/repos/gangverk/flask-swagger/deployments","created_at":"2015-03-01T01:08:16Z","updated_at":"2016-11-13T22:45:21Z","pushed_at":"2016-10-01T22:34:20Z","git_url":"git://github.com/gangverk/flask-swagger.git","ssh_url":"git@github.com:gangverk/flask-swagger.git","clone_url":"https://github.com/gangverk/flask-swagger.git","svn_url":"https://github.com/gangverk/flask-swagger","homepage":"","size":66,"stargazers_count":123,"watchers_count":123,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":37,"mirror_url":null,"open_issues_count":5,"forks":37,"open_issues":5,"watchers":123,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gangverk/flask-swagger/pulls/38"},"html":{"href":"https://github.com/gangverk/flask-swagger/pull/38"},"issue":{"href":"https://api.github.com/repos/gangverk/flask-swagger/issues/38"},"comments":{"href":"https://api.github.com/repos/gangverk/flask-swagger/issues/38/comments"},"review_comments":{"href":"https://api.github.com/repos/gangverk/flask-swagger/pulls/38/comments"},"review_comment":{"href":"https://api.github.com/repos/gangverk/flask-swagger/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gangverk/flask-swagger/pulls/38/commits"},"statuses":{"href":"https://api.github.com/repos/gangverk/flask-swagger/statuses/995620ee8b7dec2aded72e6979ef4a59e53721f5"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":1,"deletions":1,"changed_files":1}}
{"actor":{"display_login":"jamesboehmer"}}