{"action":"created","comment":{"url":"https://api.github.com/repos/dmac/spin/pulls/comments/65285151","id":65285151,"diff_hunk":"@@ -0,0 +1,110 @@\n+#lang racket\n+\n+;; A simple collection of tests to verify the correct behaviour of the \n+;; complementary path->keys and compile-path functions\n+\n+(require rackunit)\n+(require (for-syntax \"./test-syntax-utils.rkt\"))\n+\n+(define-syntax include-main-locally (ignore-lang-once))\n+(include \"../main.rkt\")\n+\n+;; verify the old behaviour\n+(check-equal? (path->keys \"/aPathBase/id\") '())\n+(check-equal? (path->keys \"/aPathBase/:id\") '(id))\n+(check-equal? (path->keys \"/aPathBase/:id1/:id2\") '(id1 id2))\n+(check-equal? (path->keys \"/aPathBase/:id1/aPathPart/:id2\") '(id1 id2))\n+\n+;; now verify the new behaviour\n+(check-equal? (path->keys \"/aRootPath/*subPath\")     '(subPath))\n+(check-equal? (path->keys \"/aRootPath/:id/*subPath\") '(id subPath))\n+(check-equal? (path->keys \"/aRootPath/*subPath/:id\") '(subPath id))\n+\n+(check-equal? (path->keys \"/aRootPath/:id1/*subPath/:id2\")\n+  '(id1 subPath id2))\n+(check-equal? (path->keys \"/aRootPath/:id1/*subPath1/:id2/*subPath2\")\n+  '(id1 subPath1 id2 subPath2))\n+\n+;; verify the old behaviour\n+(check-equal? (compile-path \"/aPathBase/id\") \"^/aPathBase/id(?:$|\\\\?)\" )\n+(check-equal? (compile-path \"/aPathBase/:id\") \"^/aPathBase/([^/?]+)(?:$|\\\\?)\" )\n+(check-equal? (compile-path \"/aPathBase/:id1/:id2\")\n+   \"^/aPathBase/([^/?]+)/([^/?]+)(?:$|\\\\?)\" )\n+(check-equal? (compile-path \"/aPathBase/:id1/aPathPart/:id2\")\n+   \"^/aPathBase/([^/?]+)/aPathPart/([^/?]+)(?:$|\\\\?)\" )\n+\n+;; now verify the new behaviour\n+(check-equal? (compile-path \"/aPathBase/*subPath\")\n+  \"^/aPathBase/([^?]+)(?:$|\\\\?)\" )\n+(check-equal? (compile-path \"/aPathBase/:id/*subPath\")\n+  \"^/aPathBase/([^/?]+)/([^?]+)(?:$|\\\\?)\" )\n+(check-equal? (compile-path \"/aPathBase/*subPath/:id\")\n+  \"^/aPathBase/([^?]+)/([^/?]+)(?:$|\\\\?)\" )\n+(check-equal? (compile-path \"/aPathBase/:id1/*subPath/:id2\")\n+  \"^/aPathBase/([^/?]+)/([^?]+)/([^/?]+)(?:$|\\\\?)\" )\n+(check-equal? (compile-path \"/aPathBase/:id1/*subPath1/:id2/*subPath2\")\n+  \"^/aPathBase/([^/?]+)/([^?]+)/([^/?]+)/([^?]+)(?:$|\\\\?)\" )\n+\n+\n+;; We now want to verify old behaviour on the construction of the\n+;; url-pairs. To keep things as simple as possible, we make small changes\n+;; to a copy of the relevant code from ../main.rkt and test it locally.\n+;;\n+;; Instead of using a request object we simply use the compiled-path and\n+;; url.\n+;;","path":"tests/path2keys.rkt","position":55,"original_position":55,"commit_id":"7bb206719b31c67d99a44710f77fa530f0c6960c","original_commit_id":"7bb206719b31c67d99a44710f77fa530f0c6960c","user":{"login":"dmac","id":151250,"avatar_url":"https://avatars.githubusercontent.com/u/151250?v=3","gravatar_id":"","url":"https://api.github.com/users/dmac","html_url":"https://github.com/dmac","followers_url":"https://api.github.com/users/dmac/followers","following_url":"https://api.github.com/users/dmac/following{/other_user}","gists_url":"https://api.github.com/users/dmac/gists{/gist_id}","starred_url":"https://api.github.com/users/dmac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmac/subscriptions","organizations_url":"https://api.github.com/users/dmac/orgs","repos_url":"https://api.github.com/users/dmac/repos","events_url":"https://api.github.com/users/dmac/events{/privacy}","received_events_url":"https://api.github.com/users/dmac/received_events","type":"User","site_admin":false},"body":"Modifying the required code sounds complex and unnecessary. Can you help me understand the purpose of doing so?","created_at":"2016-06-01T00:18:58Z","updated_at":"2016-06-01T00:18:58Z","html_url":"https://github.com/dmac/spin/pull/8#discussion_r65285151","pull_request_url":"https://api.github.com/repos/dmac/spin/pulls/8","_links":{"self":{"href":"https://api.github.com/repos/dmac/spin/pulls/comments/65285151"},"html":{"href":"https://github.com/dmac/spin/pull/8#discussion_r65285151"},"pull_request":{"href":"https://api.github.com/repos/dmac/spin/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/dmac/spin/pulls/8","id":71095976,"html_url":"https://github.com/dmac/spin/pull/8","diff_url":"https://github.com/dmac/spin/pull/8.diff","patch_url":"https://github.com/dmac/spin/pull/8.patch","issue_url":"https://api.github.com/repos/dmac/spin/issues/8","number":8,"state":"open","locked":false,"title":"Adding multi segment route parameters","user":{"login":"stephengaito","id":1078196,"avatar_url":"https://avatars.githubusercontent.com/u/1078196?v=3","gravatar_id":"","url":"https://api.github.com/users/stephengaito","html_url":"https://github.com/stephengaito","followers_url":"https://api.github.com/users/stephengaito/followers","following_url":"https://api.github.com/users/stephengaito/following{/other_user}","gists_url":"https://api.github.com/users/stephengaito/gists{/gist_id}","starred_url":"https://api.github.com/users/stephengaito/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephengaito/subscriptions","organizations_url":"https://api.github.com/users/stephengaito/orgs","repos_url":"https://api.github.com/users/stephengaito/repos","events_url":"https://api.github.com/users/stephengaito/events{/privacy}","received_events_url":"https://api.github.com/users/stephengaito/received_events","type":"User","site_admin":false},"body":"Daniel,\r\n\r\nI have a need to build a simple webserver based on your RESTful spin project.\r\n\r\nHowever my simple webserver needs to serve files from the filesystem and so I have needed to provide binary handlers, but the biggest problem I faced in doing this was that your compile-paths function currently forbids multi-field paths in the route.\r\n\r\nSO I have made the smallest possible changes to the path->keys and compile-path functions to allow the use of Rails style multi-field params in the request URLs.\r\n\r\nI have added a number of modules to provide tests of the old/new behaviour of both functions to ensure that I have made the correct changes.\r\n\r\nI have also added a short summary of the new multi-field params in the Params section of your README.md to alert users to it possible use.\r\n\r\nLet me know if there are any corrections you might want to be made to this pull request.\r\n\r\nRegards,\r\nStephen Gaito","created_at":"2016-05-23T18:16:20Z","updated_at":"2016-06-01T00:18:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"75f6df5c48a95e1195e3b5884c3511455f495bc9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dmac/spin/pulls/8/commits","review_comments_url":"https://api.github.com/repos/dmac/spin/pulls/8/comments","review_comment_url":"https://api.github.com/repos/dmac/spin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dmac/spin/issues/8/comments","statuses_url":"https://api.github.com/repos/dmac/spin/statuses/7bb206719b31c67d99a44710f77fa530f0c6960c","head":{"label":"stephengaito:adding-multi-segment-route-parameters","ref":"adding-multi-segment-route-parameters","sha":"7bb206719b31c67d99a44710f77fa530f0c6960c","user":{"login":"stephengaito","id":1078196,"avatar_url":"https://avatars.githubusercontent.com/u/1078196?v=3","gravatar_id":"","url":"https://api.github.com/users/stephengaito","html_url":"https://github.com/stephengaito","followers_url":"https://api.github.com/users/stephengaito/followers","following_url":"https://api.github.com/users/stephengaito/following{/other_user}","gists_url":"https://api.github.com/users/stephengaito/gists{/gist_id}","starred_url":"https://api.github.com/users/stephengaito/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephengaito/subscriptions","organizations_url":"https://api.github.com/users/stephengaito/orgs","repos_url":"https://api.github.com/users/stephengaito/repos","events_url":"https://api.github.com/users/stephengaito/events{/privacy}","received_events_url":"https://api.github.com/users/stephengaito/received_events","type":"User","site_admin":false},"repo":{"id":59319018,"name":"spin","full_name":"stephengaito/spin","owner":{"login":"stephengaito","id":1078196,"avatar_url":"https://avatars.githubusercontent.com/u/1078196?v=3","gravatar_id":"","url":"https://api.github.com/users/stephengaito","html_url":"https://github.com/stephengaito","followers_url":"https://api.github.com/users/stephengaito/followers","following_url":"https://api.github.com/users/stephengaito/following{/other_user}","gists_url":"https://api.github.com/users/stephengaito/gists{/gist_id}","starred_url":"https://api.github.com/users/stephengaito/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephengaito/subscriptions","organizations_url":"https://api.github.com/users/stephengaito/orgs","repos_url":"https://api.github.com/users/stephengaito/repos","events_url":"https://api.github.com/users/stephengaito/events{/privacy}","received_events_url":"https://api.github.com/users/stephengaito/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stephengaito/spin","description":"Write RESTful web apps in Racket.","fork":true,"url":"https://api.github.com/repos/stephengaito/spin","forks_url":"https://api.github.com/repos/stephengaito/spin/forks","keys_url":"https://api.github.com/repos/stephengaito/spin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stephengaito/spin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stephengaito/spin/teams","hooks_url":"https://api.github.com/repos/stephengaito/spin/hooks","issue_events_url":"https://api.github.com/repos/stephengaito/spin/issues/events{/number}","events_url":"https://api.github.com/repos/stephengaito/spin/events","assignees_url":"https://api.github.com/repos/stephengaito/spin/assignees{/user}","branches_url":"https://api.github.com/repos/stephengaito/spin/branches{/branch}","tags_url":"https://api.github.com/repos/stephengaito/spin/tags","blobs_url":"https://api.github.com/repos/stephengaito/spin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stephengaito/spin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stephengaito/spin/git/refs{/sha}","trees_url":"https://api.github.com/repos/stephengaito/spin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stephengaito/spin/statuses/{sha}","languages_url":"https://api.github.com/repos/stephengaito/spin/languages","stargazers_url":"https://api.github.com/repos/stephengaito/spin/stargazers","contributors_url":"https://api.github.com/repos/stephengaito/spin/contributors","subscribers_url":"https://api.github.com/repos/stephengaito/spin/subscribers","subscription_url":"https://api.github.com/repos/stephengaito/spin/subscription","commits_url":"https://api.github.com/repos/stephengaito/spin/commits{/sha}","git_commits_url":"https://api.github.com/repos/stephengaito/spin/git/commits{/sha}","comments_url":"https://api.github.com/repos/stephengaito/spin/comments{/number}","issue_comment_url":"https://api.github.com/repos/stephengaito/spin/issues/comments{/number}","contents_url":"https://api.github.com/repos/stephengaito/spin/contents/{+path}","compare_url":"https://api.github.com/repos/stephengaito/spin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stephengaito/spin/merges","archive_url":"https://api.github.com/repos/stephengaito/spin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stephengaito/spin/downloads","issues_url":"https://api.github.com/repos/stephengaito/spin/issues{/number}","pulls_url":"https://api.github.com/repos/stephengaito/spin/pulls{/number}","milestones_url":"https://api.github.com/repos/stephengaito/spin/milestones{/number}","notifications_url":"https://api.github.com/repos/stephengaito/spin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stephengaito/spin/labels{/name}","releases_url":"https://api.github.com/repos/stephengaito/spin/releases{/id}","deployments_url":"https://api.github.com/repos/stephengaito/spin/deployments","created_at":"2016-05-20T18:55:14Z","updated_at":"2016-05-20T18:55:15Z","pushed_at":"2016-05-26T07:17:37Z","git_url":"git://github.com/stephengaito/spin.git","ssh_url":"git@github.com:stephengaito/spin.git","clone_url":"https://github.com/stephengaito/spin.git","svn_url":"https://github.com/stephengaito/spin","homepage":"","size":37,"stargazers_count":0,"watchers_count":0,"language":"Racket","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":"dmac:master","ref":"master","sha":"d2de905712fcd3ffc977320444ea433d6a834ae8","user":{"login":"dmac","id":151250,"avatar_url":"https://avatars.githubusercontent.com/u/151250?v=3","gravatar_id":"","url":"https://api.github.com/users/dmac","html_url":"https://github.com/dmac","followers_url":"https://api.github.com/users/dmac/followers","following_url":"https://api.github.com/users/dmac/following{/other_user}","gists_url":"https://api.github.com/users/dmac/gists{/gist_id}","starred_url":"https://api.github.com/users/dmac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmac/subscriptions","organizations_url":"https://api.github.com/users/dmac/orgs","repos_url":"https://api.github.com/users/dmac/repos","events_url":"https://api.github.com/users/dmac/events{/privacy}","received_events_url":"https://api.github.com/users/dmac/received_events","type":"User","site_admin":false},"repo":{"id":2402844,"name":"spin","full_name":"dmac/spin","owner":{"login":"dmac","id":151250,"avatar_url":"https://avatars.githubusercontent.com/u/151250?v=3","gravatar_id":"","url":"https://api.github.com/users/dmac","html_url":"https://github.com/dmac","followers_url":"https://api.github.com/users/dmac/followers","following_url":"https://api.github.com/users/dmac/following{/other_user}","gists_url":"https://api.github.com/users/dmac/gists{/gist_id}","starred_url":"https://api.github.com/users/dmac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmac/subscriptions","organizations_url":"https://api.github.com/users/dmac/orgs","repos_url":"https://api.github.com/users/dmac/repos","events_url":"https://api.github.com/users/dmac/events{/privacy}","received_events_url":"https://api.github.com/users/dmac/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dmac/spin","description":"Write RESTful web apps in Racket.","fork":false,"url":"https://api.github.com/repos/dmac/spin","forks_url":"https://api.github.com/repos/dmac/spin/forks","keys_url":"https://api.github.com/repos/dmac/spin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dmac/spin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dmac/spin/teams","hooks_url":"https://api.github.com/repos/dmac/spin/hooks","issue_events_url":"https://api.github.com/repos/dmac/spin/issues/events{/number}","events_url":"https://api.github.com/repos/dmac/spin/events","assignees_url":"https://api.github.com/repos/dmac/spin/assignees{/user}","branches_url":"https://api.github.com/repos/dmac/spin/branches{/branch}","tags_url":"https://api.github.com/repos/dmac/spin/tags","blobs_url":"https://api.github.com/repos/dmac/spin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dmac/spin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dmac/spin/git/refs{/sha}","trees_url":"https://api.github.com/repos/dmac/spin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dmac/spin/statuses/{sha}","languages_url":"https://api.github.com/repos/dmac/spin/languages","stargazers_url":"https://api.github.com/repos/dmac/spin/stargazers","contributors_url":"https://api.github.com/repos/dmac/spin/contributors","subscribers_url":"https://api.github.com/repos/dmac/spin/subscribers","subscription_url":"https://api.github.com/repos/dmac/spin/subscription","commits_url":"https://api.github.com/repos/dmac/spin/commits{/sha}","git_commits_url":"https://api.github.com/repos/dmac/spin/git/commits{/sha}","comments_url":"https://api.github.com/repos/dmac/spin/comments{/number}","issue_comment_url":"https://api.github.com/repos/dmac/spin/issues/comments{/number}","contents_url":"https://api.github.com/repos/dmac/spin/contents/{+path}","compare_url":"https://api.github.com/repos/dmac/spin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dmac/spin/merges","archive_url":"https://api.github.com/repos/dmac/spin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dmac/spin/downloads","issues_url":"https://api.github.com/repos/dmac/spin/issues{/number}","pulls_url":"https://api.github.com/repos/dmac/spin/pulls{/number}","milestones_url":"https://api.github.com/repos/dmac/spin/milestones{/number}","notifications_url":"https://api.github.com/repos/dmac/spin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dmac/spin/labels{/name}","releases_url":"https://api.github.com/repos/dmac/spin/releases{/id}","deployments_url":"https://api.github.com/repos/dmac/spin/deployments","created_at":"2011-09-17T00:32:34Z","updated_at":"2016-05-28T03:11:17Z","pushed_at":"2016-05-26T07:27:01Z","git_url":"git://github.com/dmac/spin.git","ssh_url":"git@github.com:dmac/spin.git","clone_url":"https://github.com/dmac/spin.git","svn_url":"https://github.com/dmac/spin","homepage":"","size":179,"stargazers_count":118,"watchers_count":118,"language":"Racket","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":18,"mirror_url":null,"open_issues_count":4,"forks":18,"open_issues":4,"watchers":118,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dmac/spin/pulls/8"},"html":{"href":"https://github.com/dmac/spin/pull/8"},"issue":{"href":"https://api.github.com/repos/dmac/spin/issues/8"},"comments":{"href":"https://api.github.com/repos/dmac/spin/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/dmac/spin/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/dmac/spin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dmac/spin/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/dmac/spin/statuses/7bb206719b31c67d99a44710f77fa530f0c6960c"}}}}
{"actor":{"display_login":"dmac"}}