{"action":"created","comment":{"url":"https://api.github.com/repos/18F/openFEC/pulls/comments/29778322","id":29778322,"diff_hunk":"@@ -1,290 +1,131 @@\n-from flask.ext.restful import Resource, reqparse, fields, marshal_with, inputs, marshal\n-from webservices.common.models import db, Candidate, CandidateDetail, Committee, CandidateCommitteeLink, CandidateHistory\n-from webservices.common.util import default_year, Pagination\n-from sqlalchemy.sql import text, or_\n from sqlalchemy import extract\n-\n-# output format for flask-restful marshaling\n-candidate_commitee_fields = {\n-    'committee_id': fields.String,\n-    'committee_name': fields.String,\n-    'link_date': fields.String,\n-    'expire_date': fields.String,\n-    'committee_type': fields.String,\n-    'committee_type_full': fields.String,\n-    'committee_designation': fields.String,\n-    'committee_designation_full': fields.String,\n-    'election_year': fields.Integer,\n-}\n-candidate_fields = {\n-    'candidate_id': fields.String,\n-    'candidate_status_full': fields.String,\n-    'candidate_status': fields.String,\n-    'district': fields.String,\n-    'active_through': fields.Integer,\n-    'election_years': fields.List(fields.Integer),\n-    'incumbent_challenge_full': fields.String,\n-    'incumbent_challenge': fields.String,\n-    'office_full': fields.String,\n-    'office': fields.String,\n-    'party_full': fields.String,\n-    'party': fields.String,\n-    'state': fields.String,\n-    'name': fields.String,\n-}\n-candidate_detail_fields = {\n-    'candidate_id': fields.String,\n-    'candidate_status_full': fields.String,\n-    'candidate_status': fields.String,\n-    'district': fields.String,\n-    'active_through': fields.Integer,\n-    'election_years': fields.List(fields.Integer),\n-    'incumbent_challenge_full': fields.String,\n-    'incumbent_challenge': fields.String,\n-    'office_full': fields.String,\n-    'office': fields.String,\n-    'party_full': fields.String,\n-    'party': fields.String,\n-    'state': fields.String,\n-    'name': fields.String,\n-    'expire_date': fields.String,\n-    'load_date': fields.String,\n-    'form_type': fields.String,\n-    'address_city': fields.String,\n-    'address_state': fields.String,\n-    'address_street_1': fields.String,\n-    'address_street_2': fields.String,\n-    'address_zip': fields.String,\n-    'candidate_inactive': fields.String,\n-    'committees': fields.Nested(candidate_commitee_fields),\n-}\n-candidate_history_fields = {\n-    'candidate_id': fields.String,\n-    'two_year_period': fields.Integer,\n-    'candidate_status_full': fields.String,\n-    'candidate_status': fields.String,\n-    'district': fields.String,\n-    'incumbent_challenge_full': fields.String,\n-    'incumbent_challenge': fields.String,\n-    'office_full': fields.String,\n-    'office': fields.String,\n-    'party_full': fields.String,\n-    'party': fields.String,\n-    'state': fields.String,\n-    'name': fields.String,\n-    'expire_date': fields.String,\n-    'load_date': fields.String,\n-    'form_type': fields.String,\n-    'address_city': fields.String,\n-    'address_state': fields.String,\n-    'address_street_1': fields.String,\n-    'address_street_2': fields.String,\n-    'address_zip': fields.String,\n-    'candidate_inactive': fields.String,\n-}\n-pagination_fields = {\n-    'per_page': fields.Integer,\n-    'page': fields.Integer,\n-    'count': fields.Integer,\n-    'pages': fields.Integer,\n-}\n-candidate_list_fields = {\n-    'api_version': fields.Fixed(1),\n-    'pagination': fields.Nested(pagination_fields),\n-    'results': fields.Nested(candidate_fields),\n+from sqlalchemy.sql import text, or_\n+from flask.ext.restful import Resource\n+\n+from webservices import args\n+from webservices import spec\n+from webservices import paging\n+from webservices import schemas\n+from webservices.common.util import filter_query\n+from webservices.common.models import db, Candidate, CandidateDetail, CandidateHistory, CandidateCommitteeLink\n+\n+\n+filter_fields = {\n+    'candidate_id',\n+    'candidate_status',\n+    'district',\n+    'incumbent_challenge',\n+    'office',\n+    'party',\n+    'state',","path":"webservices/resources/candidates.py","position":113,"original_position":113,"commit_id":"54d335c2602e184a3a6c929554a1955f3fb64914","original_commit_id":"54d335c2602e184a3a6c929554a1955f3fb64914","user":{"login":"LindsayYoung","id":4406333,"avatar_url":"https://avatars.githubusercontent.com/u/4406333?v=3","gravatar_id":"","url":"https://api.github.com/users/LindsayYoung","html_url":"https://github.com/LindsayYoung","followers_url":"https://api.github.com/users/LindsayYoung/followers","following_url":"https://api.github.com/users/LindsayYoung/following{/other_user}","gists_url":"https://api.github.com/users/LindsayYoung/gists{/gist_id}","starred_url":"https://api.github.com/users/LindsayYoung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LindsayYoung/subscriptions","organizations_url":"https://api.github.com/users/LindsayYoung/orgs","repos_url":"https://api.github.com/users/LindsayYoung/repos","events_url":"https://api.github.com/users/LindsayYoung/events{/privacy}","received_events_url":"https://api.github.com/users/LindsayYoung/received_events","type":"User","site_admin":false},"body":"We need a year filter for `/candidates` is this list just for detail and history?","created_at":"2015-05-06T16:56:57Z","updated_at":"2015-05-06T16:56:57Z","html_url":"https://github.com/18F/openFEC/pull/662#discussion_r29778322","pull_request_url":"https://api.github.com/repos/18F/openFEC/pulls/662","_links":{"self":{"href":"https://api.github.com/repos/18F/openFEC/pulls/comments/29778322"},"html":{"href":"https://github.com/18F/openFEC/pull/662#discussion_r29778322"},"pull_request":{"href":"https://api.github.com/repos/18F/openFEC/pulls/662"}}},"pull_request":{"url":"https://api.github.com/repos/18F/openFEC/pulls/662","id":34397169,"html_url":"https://github.com/18F/openFEC/pull/662","diff_url":"https://github.com/18F/openFEC/pull/662.diff","patch_url":"https://github.com/18F/openFEC/pull/662.patch","issue_url":"https://api.github.com/repos/18F/openFEC/issues/662","number":662,"state":"open","locked":false,"title":"Feature/apidoc","user":{"login":"jmcarp","id":1633460,"avatar_url":"https://avatars.githubusercontent.com/u/1633460?v=3","gravatar_id":"","url":"https://api.github.com/users/jmcarp","html_url":"https://github.com/jmcarp","followers_url":"https://api.github.com/users/jmcarp/followers","following_url":"https://api.github.com/users/jmcarp/following{/other_user}","gists_url":"https://api.github.com/users/jmcarp/gists{/gist_id}","starred_url":"https://api.github.com/users/jmcarp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmcarp/subscriptions","organizations_url":"https://api.github.com/users/jmcarp/orgs","repos_url":"https://api.github.com/users/jmcarp/repos","events_url":"https://api.github.com/users/jmcarp/events{/privacy}","received_events_url":"https://api.github.com/users/jmcarp/received_events","type":"User","site_admin":false},"body":"Replacement for #571.","created_at":"2015-04-29T19:27:40Z","updated_at":"2015-05-06T16:56:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"51e81ae03186d5bfb63444932eef740f8203e6a5","assignee":{"login":"LindsayYoung","id":4406333,"avatar_url":"https://avatars.githubusercontent.com/u/4406333?v=3","gravatar_id":"","url":"https://api.github.com/users/LindsayYoung","html_url":"https://github.com/LindsayYoung","followers_url":"https://api.github.com/users/LindsayYoung/followers","following_url":"https://api.github.com/users/LindsayYoung/following{/other_user}","gists_url":"https://api.github.com/users/LindsayYoung/gists{/gist_id}","starred_url":"https://api.github.com/users/LindsayYoung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LindsayYoung/subscriptions","organizations_url":"https://api.github.com/users/LindsayYoung/orgs","repos_url":"https://api.github.com/users/LindsayYoung/repos","events_url":"https://api.github.com/users/LindsayYoung/events{/privacy}","received_events_url":"https://api.github.com/users/LindsayYoung/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/18F/openFEC/pulls/662/commits","review_comments_url":"https://api.github.com/repos/18F/openFEC/pulls/662/comments","review_comment_url":"https://api.github.com/repos/18F/openFEC/pulls/comments{/number}","comments_url":"https://api.github.com/repos/18F/openFEC/issues/662/comments","statuses_url":"https://api.github.com/repos/18F/openFEC/statuses/54d335c2602e184a3a6c929554a1955f3fb64914","head":{"label":"jmcarp:feature/apidoc","ref":"feature/apidoc","sha":"54d335c2602e184a3a6c929554a1955f3fb64914","user":{"login":"jmcarp","id":1633460,"avatar_url":"https://avatars.githubusercontent.com/u/1633460?v=3","gravatar_id":"","url":"https://api.github.com/users/jmcarp","html_url":"https://github.com/jmcarp","followers_url":"https://api.github.com/users/jmcarp/followers","following_url":"https://api.github.com/users/jmcarp/following{/other_user}","gists_url":"https://api.github.com/users/jmcarp/gists{/gist_id}","starred_url":"https://api.github.com/users/jmcarp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmcarp/subscriptions","organizations_url":"https://api.github.com/users/jmcarp/orgs","repos_url":"https://api.github.com/users/jmcarp/repos","events_url":"https://api.github.com/users/jmcarp/events{/privacy}","received_events_url":"https://api.github.com/users/jmcarp/received_events","type":"User","site_admin":false},"repo":{"id":33560779,"name":"openFEC","full_name":"jmcarp/openFEC","owner":{"login":"jmcarp","id":1633460,"avatar_url":"https://avatars.githubusercontent.com/u/1633460?v=3","gravatar_id":"","url":"https://api.github.com/users/jmcarp","html_url":"https://github.com/jmcarp","followers_url":"https://api.github.com/users/jmcarp/followers","following_url":"https://api.github.com/users/jmcarp/following{/other_user}","gists_url":"https://api.github.com/users/jmcarp/gists{/gist_id}","starred_url":"https://api.github.com/users/jmcarp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmcarp/subscriptions","organizations_url":"https://api.github.com/users/jmcarp/orgs","repos_url":"https://api.github.com/users/jmcarp/repos","events_url":"https://api.github.com/users/jmcarp/events{/privacy}","received_events_url":"https://api.github.com/users/jmcarp/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jmcarp/openFEC","description":"An experiment in taking data from the Federal Election Commission and harmonizing/cleaning it up to make it easier for external developers to use and analyze.","fork":true,"url":"https://api.github.com/repos/jmcarp/openFEC","forks_url":"https://api.github.com/repos/jmcarp/openFEC/forks","keys_url":"https://api.github.com/repos/jmcarp/openFEC/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jmcarp/openFEC/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jmcarp/openFEC/teams","hooks_url":"https://api.github.com/repos/jmcarp/openFEC/hooks","issue_events_url":"https://api.github.com/repos/jmcarp/openFEC/issues/events{/number}","events_url":"https://api.github.com/repos/jmcarp/openFEC/events","assignees_url":"https://api.github.com/repos/jmcarp/openFEC/assignees{/user}","branches_url":"https://api.github.com/repos/jmcarp/openFEC/branches{/branch}","tags_url":"https://api.github.com/repos/jmcarp/openFEC/tags","blobs_url":"https://api.github.com/repos/jmcarp/openFEC/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jmcarp/openFEC/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jmcarp/openFEC/git/refs{/sha}","trees_url":"https://api.github.com/repos/jmcarp/openFEC/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jmcarp/openFEC/statuses/{sha}","languages_url":"https://api.github.com/repos/jmcarp/openFEC/languages","stargazers_url":"https://api.github.com/repos/jmcarp/openFEC/stargazers","contributors_url":"https://api.github.com/repos/jmcarp/openFEC/contributors","subscribers_url":"https://api.github.com/repos/jmcarp/openFEC/subscribers","subscription_url":"https://api.github.com/repos/jmcarp/openFEC/subscription","commits_url":"https://api.github.com/repos/jmcarp/openFEC/commits{/sha}","git_commits_url":"https://api.github.com/repos/jmcarp/openFEC/git/commits{/sha}","comments_url":"https://api.github.com/repos/jmcarp/openFEC/comments{/number}","issue_comment_url":"https://api.github.com/repos/jmcarp/openFEC/issues/comments{/number}","contents_url":"https://api.github.com/repos/jmcarp/openFEC/contents/{+path}","compare_url":"https://api.github.com/repos/jmcarp/openFEC/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jmcarp/openFEC/merges","archive_url":"https://api.github.com/repos/jmcarp/openFEC/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jmcarp/openFEC/downloads","issues_url":"https://api.github.com/repos/jmcarp/openFEC/issues{/number}","pulls_url":"https://api.github.com/repos/jmcarp/openFEC/pulls{/number}","milestones_url":"https://api.github.com/repos/jmcarp/openFEC/milestones{/number}","notifications_url":"https://api.github.com/repos/jmcarp/openFEC/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jmcarp/openFEC/labels{/name}","releases_url":"https://api.github.com/repos/jmcarp/openFEC/releases{/id}","created_at":"2015-04-07T18:28:37Z","updated_at":"2015-04-07T18:28:38Z","pushed_at":"2015-05-06T13:59:42Z","git_url":"git://github.com/jmcarp/openFEC.git","ssh_url":"git@github.com:jmcarp/openFEC.git","clone_url":"https://github.com/jmcarp/openFEC.git","svn_url":"https://github.com/jmcarp/openFEC","homepage":null,"size":15197,"stargazers_count":0,"watchers_count":0,"language":"SQLPL","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":"18F:develop","ref":"develop","sha":"8b023562a136dc5c1bd92e5acb8db6e598a5ef7a","user":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"repo":{"id":23116127,"name":"openFEC","full_name":"18F/openFEC","owner":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/18F/openFEC","description":"An experiment in taking data from the Federal Election Commission and harmonizing/cleaning it up to make it easier for external developers to use and analyze.","fork":false,"url":"https://api.github.com/repos/18F/openFEC","forks_url":"https://api.github.com/repos/18F/openFEC/forks","keys_url":"https://api.github.com/repos/18F/openFEC/keys{/key_id}","collaborators_url":"https://api.github.com/repos/18F/openFEC/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/18F/openFEC/teams","hooks_url":"https://api.github.com/repos/18F/openFEC/hooks","issue_events_url":"https://api.github.com/repos/18F/openFEC/issues/events{/number}","events_url":"https://api.github.com/repos/18F/openFEC/events","assignees_url":"https://api.github.com/repos/18F/openFEC/assignees{/user}","branches_url":"https://api.github.com/repos/18F/openFEC/branches{/branch}","tags_url":"https://api.github.com/repos/18F/openFEC/tags","blobs_url":"https://api.github.com/repos/18F/openFEC/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/18F/openFEC/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/18F/openFEC/git/refs{/sha}","trees_url":"https://api.github.com/repos/18F/openFEC/git/trees{/sha}","statuses_url":"https://api.github.com/repos/18F/openFEC/statuses/{sha}","languages_url":"https://api.github.com/repos/18F/openFEC/languages","stargazers_url":"https://api.github.com/repos/18F/openFEC/stargazers","contributors_url":"https://api.github.com/repos/18F/openFEC/contributors","subscribers_url":"https://api.github.com/repos/18F/openFEC/subscribers","subscription_url":"https://api.github.com/repos/18F/openFEC/subscription","commits_url":"https://api.github.com/repos/18F/openFEC/commits{/sha}","git_commits_url":"https://api.github.com/repos/18F/openFEC/git/commits{/sha}","comments_url":"https://api.github.com/repos/18F/openFEC/comments{/number}","issue_comment_url":"https://api.github.com/repos/18F/openFEC/issues/comments{/number}","contents_url":"https://api.github.com/repos/18F/openFEC/contents/{+path}","compare_url":"https://api.github.com/repos/18F/openFEC/compare/{base}...{head}","merges_url":"https://api.github.com/repos/18F/openFEC/merges","archive_url":"https://api.github.com/repos/18F/openFEC/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/18F/openFEC/downloads","issues_url":"https://api.github.com/repos/18F/openFEC/issues{/number}","pulls_url":"https://api.github.com/repos/18F/openFEC/pulls{/number}","milestones_url":"https://api.github.com/repos/18F/openFEC/milestones{/number}","notifications_url":"https://api.github.com/repos/18F/openFEC/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/18F/openFEC/labels{/name}","releases_url":"https://api.github.com/repos/18F/openFEC/releases{/id}","created_at":"2014-08-19T15:51:14Z","updated_at":"2015-05-06T14:37:16Z","pushed_at":"2015-05-06T14:37:16Z","git_url":"git://github.com/18F/openFEC.git","ssh_url":"git@github.com:18F/openFEC.git","clone_url":"https://github.com/18F/openFEC.git","svn_url":"https://github.com/18F/openFEC","homepage":null,"size":18505,"stargazers_count":53,"watchers_count":53,"language":"SQLPL","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":122,"forks":11,"open_issues":122,"watchers":53,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/18F/openFEC/pulls/662"},"html":{"href":"https://github.com/18F/openFEC/pull/662"},"issue":{"href":"https://api.github.com/repos/18F/openFEC/issues/662"},"comments":{"href":"https://api.github.com/repos/18F/openFEC/issues/662/comments"},"review_comments":{"href":"https://api.github.com/repos/18F/openFEC/pulls/662/comments"},"review_comment":{"href":"https://api.github.com/repos/18F/openFEC/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/18F/openFEC/pulls/662/commits"},"statuses":{"href":"https://api.github.com/repos/18F/openFEC/statuses/54d335c2602e184a3a6c929554a1955f3fb64914"}}}}