{"action":"created","comment":{"url":"https://api.github.com/repos/PEDSnet/tools/pulls/comments/42823487","id":42823487,"diff_hunk":"@@ -257,27 +268,63 @@ def index():\n             'uuid': SERVICE_ID,\n         })\n \n-    app.add_url_rule('/pedsnet',\n+    \"\"\"\n+    Make sure all urls end with a slash. The version without a trailing slash\n+    will be taken care of automatically because Flask will automatically\n+    redirect the user to the same URL with a trailing slash attached.\n+    The reverse is not true.\n+    \"\"\"\n+\n+    app.add_url_rule('/pedsnet/',\n                      'pedsnet_versions',\n                      dqa_resource.serve_versions,\n                      methods=['GET'])\n \n     for version in dqa_resource.get_versions():\n-        app.add_url_rule('/pedsnet/' + version + '/field-totals',\n+        app.add_url_rule('/pedsnet/' + version + '/field-totals/',\n                          version + '_' + 'field-totals',\n                          dqa_resource.serve_field_totals(version),\n                          methods=['GET'])\n \n-        app.add_url_rule('/pedsnet/' + version + '/site-totals',\n+        for table in dqa_resource.field_totals[version]:\n+            app.add_url_rule(('/pedsnet/' + version + '/field-totals/' +\n+                              table.replace('_', '-') + '/'),","path":"services/dqa-secondary-reports/main.py","position":141,"original_position":141,"commit_id":"347123c17f37ea6138c722c06f30f024f0c01a2e","original_commit_id":"347123c17f37ea6138c722c06f30f024f0c01a2e","user":{"login":"bruth","id":515142,"avatar_url":"https://avatars.githubusercontent.com/u/515142?v=3","gravatar_id":"","url":"https://api.github.com/users/bruth","html_url":"https://github.com/bruth","followers_url":"https://api.github.com/users/bruth/followers","following_url":"https://api.github.com/users/bruth/following{/other_user}","gists_url":"https://api.github.com/users/bruth/gists{/gist_id}","starred_url":"https://api.github.com/users/bruth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bruth/subscriptions","organizations_url":"https://api.github.com/users/bruth/orgs","repos_url":"https://api.github.com/users/bruth/repos","events_url":"https://api.github.com/users/bruth/events{/privacy}","received_events_url":"https://api.github.com/users/bruth/received_events","type":"User","site_admin":false},"body":"You're going to hate me for this, but for identifiers as parameters it is perfectly fine to leave the underscores. I know said the convention is hyphens, but that is for static segments of the path. For parameters, it is more clear leaving them as is.","created_at":"2015-10-23T00:38:47Z","updated_at":"2015-10-23T00:38:47Z","html_url":"https://github.com/PEDSnet/tools/pull/40#discussion_r42823487","pull_request_url":"https://api.github.com/repos/PEDSnet/tools/pulls/40","_links":{"self":{"href":"https://api.github.com/repos/PEDSnet/tools/pulls/comments/42823487"},"html":{"href":"https://github.com/PEDSnet/tools/pull/40#discussion_r42823487"},"pull_request":{"href":"https://api.github.com/repos/PEDSnet/tools/pulls/40"}}},"pull_request":{"url":"https://api.github.com/repos/PEDSnet/tools/pulls/40","id":48481171,"html_url":"https://github.com/PEDSnet/tools/pull/40","diff_url":"https://github.com/PEDSnet/tools/pull/40.diff","patch_url":"https://github.com/PEDSnet/tools/pull/40.patch","issue_url":"https://api.github.com/repos/PEDSnet/tools/issues/40","number":40,"state":"open","locked":false,"title":"enable more granular requests for DQA data","user":{"login":"l-k-","id":6386739,"avatar_url":"https://avatars.githubusercontent.com/u/6386739?v=3","gravatar_id":"","url":"https://api.github.com/users/l-k-","html_url":"https://github.com/l-k-","followers_url":"https://api.github.com/users/l-k-/followers","following_url":"https://api.github.com/users/l-k-/following{/other_user}","gists_url":"https://api.github.com/users/l-k-/gists{/gist_id}","starred_url":"https://api.github.com/users/l-k-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/l-k-/subscriptions","organizations_url":"https://api.github.com/users/l-k-/orgs","repos_url":"https://api.github.com/users/l-k-/repos","events_url":"https://api.github.com/users/l-k-/events{/privacy}","received_events_url":"https://api.github.com/users/l-k-/received_events","type":"User","site_admin":false},"body":"enable requests for data for specific site, e.g.\r\n/pedsnet/2.0.0/site-totals/Nationwide\r\n\r\nas well as specific table and field:\r\n/pedsnet/2.0.0/table-totals/care-site\r\n/pedsnet/2.0.0/field-totals/care-site\r\n/pedsnet/2.0.0/field-totals/care-site/care-site-id","created_at":"2015-10-22T16:32:50Z","updated_at":"2015-10-23T00:38:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5be09f4befba81acfefb67ee52048e0f973ebccc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/PEDSnet/tools/pulls/40/commits","review_comments_url":"https://api.github.com/repos/PEDSnet/tools/pulls/40/comments","review_comment_url":"https://api.github.com/repos/PEDSnet/tools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PEDSnet/tools/issues/40/comments","statuses_url":"https://api.github.com/repos/PEDSnet/tools/statuses/347123c17f37ea6138c722c06f30f024f0c01a2e","head":{"label":"l-k-:master","ref":"master","sha":"347123c17f37ea6138c722c06f30f024f0c01a2e","user":{"login":"l-k-","id":6386739,"avatar_url":"https://avatars.githubusercontent.com/u/6386739?v=3","gravatar_id":"","url":"https://api.github.com/users/l-k-","html_url":"https://github.com/l-k-","followers_url":"https://api.github.com/users/l-k-/followers","following_url":"https://api.github.com/users/l-k-/following{/other_user}","gists_url":"https://api.github.com/users/l-k-/gists{/gist_id}","starred_url":"https://api.github.com/users/l-k-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/l-k-/subscriptions","organizations_url":"https://api.github.com/users/l-k-/orgs","repos_url":"https://api.github.com/users/l-k-/repos","events_url":"https://api.github.com/users/l-k-/events{/privacy}","received_events_url":"https://api.github.com/users/l-k-/received_events","type":"User","site_admin":false},"repo":{"id":44755275,"name":"tools","full_name":"l-k-/tools","owner":{"login":"l-k-","id":6386739,"avatar_url":"https://avatars.githubusercontent.com/u/6386739?v=3","gravatar_id":"","url":"https://api.github.com/users/l-k-","html_url":"https://github.com/l-k-","followers_url":"https://api.github.com/users/l-k-/followers","following_url":"https://api.github.com/users/l-k-/following{/other_user}","gists_url":"https://api.github.com/users/l-k-/gists{/gist_id}","starred_url":"https://api.github.com/users/l-k-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/l-k-/subscriptions","organizations_url":"https://api.github.com/users/l-k-/orgs","repos_url":"https://api.github.com/users/l-k-/repos","events_url":"https://api.github.com/users/l-k-/events{/privacy}","received_events_url":"https://api.github.com/users/l-k-/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/l-k-/tools","description":"Various tools and services for PEDSnet.","fork":true,"url":"https://api.github.com/repos/l-k-/tools","forks_url":"https://api.github.com/repos/l-k-/tools/forks","keys_url":"https://api.github.com/repos/l-k-/tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/l-k-/tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/l-k-/tools/teams","hooks_url":"https://api.github.com/repos/l-k-/tools/hooks","issue_events_url":"https://api.github.com/repos/l-k-/tools/issues/events{/number}","events_url":"https://api.github.com/repos/l-k-/tools/events","assignees_url":"https://api.github.com/repos/l-k-/tools/assignees{/user}","branches_url":"https://api.github.com/repos/l-k-/tools/branches{/branch}","tags_url":"https://api.github.com/repos/l-k-/tools/tags","blobs_url":"https://api.github.com/repos/l-k-/tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/l-k-/tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/l-k-/tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/l-k-/tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/l-k-/tools/statuses/{sha}","languages_url":"https://api.github.com/repos/l-k-/tools/languages","stargazers_url":"https://api.github.com/repos/l-k-/tools/stargazers","contributors_url":"https://api.github.com/repos/l-k-/tools/contributors","subscribers_url":"https://api.github.com/repos/l-k-/tools/subscribers","subscription_url":"https://api.github.com/repos/l-k-/tools/subscription","commits_url":"https://api.github.com/repos/l-k-/tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/l-k-/tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/l-k-/tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/l-k-/tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/l-k-/tools/contents/{+path}","compare_url":"https://api.github.com/repos/l-k-/tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/l-k-/tools/merges","archive_url":"https://api.github.com/repos/l-k-/tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/l-k-/tools/downloads","issues_url":"https://api.github.com/repos/l-k-/tools/issues{/number}","pulls_url":"https://api.github.com/repos/l-k-/tools/pulls{/number}","milestones_url":"https://api.github.com/repos/l-k-/tools/milestones{/number}","notifications_url":"https://api.github.com/repos/l-k-/tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/l-k-/tools/labels{/name}","releases_url":"https://api.github.com/repos/l-k-/tools/releases{/id}","created_at":"2015-10-22T15:38:37Z","updated_at":"2015-10-22T16:30:32Z","pushed_at":"2015-10-22T17:06:52Z","git_url":"git://github.com/l-k-/tools.git","ssh_url":"git@github.com:l-k-/tools.git","clone_url":"https://github.com/l-k-/tools.git","svn_url":"https://github.com/l-k-/tools","homepage":"","size":509,"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":"PEDSnet:master","ref":"master","sha":"fa585ea7eb5ab94a2c23123dfebcdc079e55940b","user":{"login":"PEDSnet","id":7228066,"avatar_url":"https://avatars.githubusercontent.com/u/7228066?v=3","gravatar_id":"","url":"https://api.github.com/users/PEDSnet","html_url":"https://github.com/PEDSnet","followers_url":"https://api.github.com/users/PEDSnet/followers","following_url":"https://api.github.com/users/PEDSnet/following{/other_user}","gists_url":"https://api.github.com/users/PEDSnet/gists{/gist_id}","starred_url":"https://api.github.com/users/PEDSnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PEDSnet/subscriptions","organizations_url":"https://api.github.com/users/PEDSnet/orgs","repos_url":"https://api.github.com/users/PEDSnet/repos","events_url":"https://api.github.com/users/PEDSnet/events{/privacy}","received_events_url":"https://api.github.com/users/PEDSnet/received_events","type":"Organization","site_admin":false},"repo":{"id":37086351,"name":"tools","full_name":"PEDSnet/tools","owner":{"login":"PEDSnet","id":7228066,"avatar_url":"https://avatars.githubusercontent.com/u/7228066?v=3","gravatar_id":"","url":"https://api.github.com/users/PEDSnet","html_url":"https://github.com/PEDSnet","followers_url":"https://api.github.com/users/PEDSnet/followers","following_url":"https://api.github.com/users/PEDSnet/following{/other_user}","gists_url":"https://api.github.com/users/PEDSnet/gists{/gist_id}","starred_url":"https://api.github.com/users/PEDSnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PEDSnet/subscriptions","organizations_url":"https://api.github.com/users/PEDSnet/orgs","repos_url":"https://api.github.com/users/PEDSnet/repos","events_url":"https://api.github.com/users/PEDSnet/events{/privacy}","received_events_url":"https://api.github.com/users/PEDSnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PEDSnet/tools","description":"Various tools and services for PEDSnet.","fork":false,"url":"https://api.github.com/repos/PEDSnet/tools","forks_url":"https://api.github.com/repos/PEDSnet/tools/forks","keys_url":"https://api.github.com/repos/PEDSnet/tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PEDSnet/tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PEDSnet/tools/teams","hooks_url":"https://api.github.com/repos/PEDSnet/tools/hooks","issue_events_url":"https://api.github.com/repos/PEDSnet/tools/issues/events{/number}","events_url":"https://api.github.com/repos/PEDSnet/tools/events","assignees_url":"https://api.github.com/repos/PEDSnet/tools/assignees{/user}","branches_url":"https://api.github.com/repos/PEDSnet/tools/branches{/branch}","tags_url":"https://api.github.com/repos/PEDSnet/tools/tags","blobs_url":"https://api.github.com/repos/PEDSnet/tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PEDSnet/tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PEDSnet/tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/PEDSnet/tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PEDSnet/tools/statuses/{sha}","languages_url":"https://api.github.com/repos/PEDSnet/tools/languages","stargazers_url":"https://api.github.com/repos/PEDSnet/tools/stargazers","contributors_url":"https://api.github.com/repos/PEDSnet/tools/contributors","subscribers_url":"https://api.github.com/repos/PEDSnet/tools/subscribers","subscription_url":"https://api.github.com/repos/PEDSnet/tools/subscription","commits_url":"https://api.github.com/repos/PEDSnet/tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/PEDSnet/tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/PEDSnet/tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/PEDSnet/tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/PEDSnet/tools/contents/{+path}","compare_url":"https://api.github.com/repos/PEDSnet/tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PEDSnet/tools/merges","archive_url":"https://api.github.com/repos/PEDSnet/tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PEDSnet/tools/downloads","issues_url":"https://api.github.com/repos/PEDSnet/tools/issues{/number}","pulls_url":"https://api.github.com/repos/PEDSnet/tools/pulls{/number}","milestones_url":"https://api.github.com/repos/PEDSnet/tools/milestones{/number}","notifications_url":"https://api.github.com/repos/PEDSnet/tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PEDSnet/tools/labels{/name}","releases_url":"https://api.github.com/repos/PEDSnet/tools/releases{/id}","created_at":"2015-06-08T18:58:01Z","updated_at":"2015-10-02T12:23:46Z","pushed_at":"2015-10-22T17:06:52Z","git_url":"git://github.com/PEDSnet/tools.git","ssh_url":"git@github.com:PEDSnet/tools.git","clone_url":"https://github.com/PEDSnet/tools.git","svn_url":"https://github.com/PEDSnet/tools","homepage":"","size":509,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":5,"forks":1,"open_issues":5,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/PEDSnet/tools/pulls/40"},"html":{"href":"https://github.com/PEDSnet/tools/pull/40"},"issue":{"href":"https://api.github.com/repos/PEDSnet/tools/issues/40"},"comments":{"href":"https://api.github.com/repos/PEDSnet/tools/issues/40/comments"},"review_comments":{"href":"https://api.github.com/repos/PEDSnet/tools/pulls/40/comments"},"review_comment":{"href":"https://api.github.com/repos/PEDSnet/tools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PEDSnet/tools/pulls/40/commits"},"statuses":{"href":"https://api.github.com/repos/PEDSnet/tools/statuses/347123c17f37ea6138c722c06f30f024f0c01a2e"}}}}