{"action":"created","comment":{"url":"https://api.github.com/repos/playframework/playframework/pulls/comments/224603165","pull_request_review_id":164013747,"id":224603165,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNDYwMzE2NQ==","diff_hunk":"@@ -73,10 +73,26 @@ object RoutesFileParser {\n           Some(route.call.pos.column))\n       }\n \n+      route.call.parameters.getOrElse(Nil).find(_.isJRequest).map { p =>","path":"framework/src/routes-compiler/src/main/scala/play/routes/compiler/RoutesFileParser.scala","position":null,"original_position":4,"commit_id":"3399344164373b5a9e6d89840d6db5d3ee2ab56d","original_commit_id":"2fa1cdc5b7d28d258ed24d0c8a2f580a2e6b9e90","user":{"login":"mkurz","id":644927,"node_id":"MDQ6VXNlcjY0NDkyNw==","avatar_url":"https://avatars2.githubusercontent.com/u/644927?v=4","gravatar_id":"","url":"https://api.github.com/users/mkurz","html_url":"https://github.com/mkurz","followers_url":"https://api.github.com/users/mkurz/followers","following_url":"https://api.github.com/users/mkurz/following{/other_user}","gists_url":"https://api.github.com/users/mkurz/gists{/gist_id}","starred_url":"https://api.github.com/users/mkurz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkurz/subscriptions","organizations_url":"https://api.github.com/users/mkurz/orgs","repos_url":"https://api.github.com/users/mkurz/repos","events_url":"https://api.github.com/users/mkurz/events{/privacy}","received_events_url":"https://api.github.com/users/mkurz/received_events","type":"User","site_admin":false},"body":"Changed.","created_at":"2018-10-11T21:01:20Z","updated_at":"2018-10-11T21:01:21Z","html_url":"https://github.com/playframework/playframework/pull/8639#discussion_r224603165","pull_request_url":"https://api.github.com/repos/playframework/playframework/pulls/8639","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/playframework/playframework/pulls/comments/224603165"},"html":{"href":"https://github.com/playframework/playframework/pull/8639#discussion_r224603165"},"pull_request":{"href":"https://api.github.com/repos/playframework/playframework/pulls/8639"}},"in_reply_to_id":224510242},"pull_request":{"url":"https://api.github.com/repos/playframework/playframework/pulls/8639","id":218827986,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE4ODI3OTg2","html_url":"https://github.com/playframework/playframework/pull/8639","diff_url":"https://github.com/playframework/playframework/pull/8639.diff","patch_url":"https://github.com/playframework/playframework/pull/8639.patch","issue_url":"https://api.github.com/repos/playframework/playframework/issues/8639","number":8639,"state":"open","locked":false,"title":"Pass request to action methods / Add new Action class that takes a request","user":{"login":"mkurz","id":644927,"node_id":"MDQ6VXNlcjY0NDkyNw==","avatar_url":"https://avatars2.githubusercontent.com/u/644927?v=4","gravatar_id":"","url":"https://api.github.com/users/mkurz","html_url":"https://github.com/mkurz","followers_url":"https://api.github.com/users/mkurz/followers","following_url":"https://api.github.com/users/mkurz/following{/other_user}","gists_url":"https://api.github.com/users/mkurz/gists{/gist_id}","starred_url":"https://api.github.com/users/mkurz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkurz/subscriptions","organizations_url":"https://api.github.com/users/mkurz/orgs","repos_url":"https://api.github.com/users/mkurz/repos","events_url":"https://api.github.com/users/mkurz/events{/privacy}","received_events_url":"https://api.github.com/users/mkurz/received_events","type":"User","site_admin":false},"body":"Hey @marcospereira,\r\n\r\nhere we go. This is a working solution on how we can pass a Java request to an action method so soon there is no need for `Http.Context` anymore :smile: \r\n\r\nYou can now manually mark a route with a `+` modifier:\r\n```java\r\nGET    /            +controllers.SomeController.index()\r\n```\r\nDoing so passes the Java `Http.Request` object as first parameter to the corresponding action method:\r\n```java\r\npublic Result index(Http.Request request,...) {...}\r\n```\r\nI did some tests and until now everything works great. Reverse routing works, the error page which displays the routes in dev mode works, etc.\r\n\r\nBut that's not all! I also added your suggested `NewAction` class which defines a `call(Http.Request)` method like you said. And it's working as well. I did some tests and it works like a charm - you can even mix \"old\" the `Action` with the `NewAction` during action composition - no problem. Also e.g. if you do stuff like `next.call(req.addAttr(someAttr))` during action composition that `someAttr` is later availabe in the action method (via the request you get via `+` or via `Http.Context.current().request()` ;)) I think this is the way to go to for switching from context to request in action composition without breaking stuff.\r\n\r\nWhat do you think?\r\nWhat's missing is tests of course and documentation updates. (And we still need to deprecate and provide alternatives for all the `Http.Context` methods in other pull requests).","created_at":"2018-09-28T01:08:32Z","updated_at":"2018-10-11T21:01:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7e78bb57a7cfb4ec10a94b2fd0445b214f1f9add","assignee":{"login":"mkurz","id":644927,"node_id":"MDQ6VXNlcjY0NDkyNw==","avatar_url":"https://avatars2.githubusercontent.com/u/644927?v=4","gravatar_id":"","url":"https://api.github.com/users/mkurz","html_url":"https://github.com/mkurz","followers_url":"https://api.github.com/users/mkurz/followers","following_url":"https://api.github.com/users/mkurz/following{/other_user}","gists_url":"https://api.github.com/users/mkurz/gists{/gist_id}","starred_url":"https://api.github.com/users/mkurz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkurz/subscriptions","organizations_url":"https://api.github.com/users/mkurz/orgs","repos_url":"https://api.github.com/users/mkurz/repos","events_url":"https://api.github.com/users/mkurz/events{/privacy}","received_events_url":"https://api.github.com/users/mkurz/received_events","type":"User","site_admin":false},"assignees":[{"login":"mkurz","id":644927,"node_id":"MDQ6VXNlcjY0NDkyNw==","avatar_url":"https://avatars2.githubusercontent.com/u/644927?v=4","gravatar_id":"","url":"https://api.github.com/users/mkurz","html_url":"https://github.com/mkurz","followers_url":"https://api.github.com/users/mkurz/followers","following_url":"https://api.github.com/users/mkurz/following{/other_user}","gists_url":"https://api.github.com/users/mkurz/gists{/gist_id}","starred_url":"https://api.github.com/users/mkurz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkurz/subscriptions","organizations_url":"https://api.github.com/users/mkurz/orgs","repos_url":"https://api.github.com/users/mkurz/repos","events_url":"https://api.github.com/users/mkurz/events{/privacy}","received_events_url":"https://api.github.com/users/mkurz/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1070250053,"node_id":"MDU6TGFiZWwxMDcwMjUwMDUz","url":"https://api.github.com/repos/playframework/playframework/labels/in%20progress","name":"in progress","color":"e9bf55","default":false}],"milestone":{"url":"https://api.github.com/repos/playframework/playframework/milestones/56","html_url":"https://github.com/playframework/playframework/milestone/56","labels_url":"https://api.github.com/repos/playframework/playframework/milestones/56/labels","id":2599231,"node_id":"MDk6TWlsZXN0b25lMjU5OTIzMQ==","number":56,"title":"Play 2.7.0","description":"","creator":{"login":"gmethvin","id":171663,"node_id":"MDQ6VXNlcjE3MTY2Mw==","avatar_url":"https://avatars1.githubusercontent.com/u/171663?v=4","gravatar_id":"","url":"https://api.github.com/users/gmethvin","html_url":"https://github.com/gmethvin","followers_url":"https://api.github.com/users/gmethvin/followers","following_url":"https://api.github.com/users/gmethvin/following{/other_user}","gists_url":"https://api.github.com/users/gmethvin/gists{/gist_id}","starred_url":"https://api.github.com/users/gmethvin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmethvin/subscriptions","organizations_url":"https://api.github.com/users/gmethvin/orgs","repos_url":"https://api.github.com/users/gmethvin/repos","events_url":"https://api.github.com/users/gmethvin/events{/privacy}","received_events_url":"https://api.github.com/users/gmethvin/received_events","type":"User","site_admin":false},"open_issues":14,"closed_issues":51,"state":"open","created_at":"2017-06-22T19:55:39Z","updated_at":"2018-10-11T15:02:48Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/playframework/playframework/pulls/8639/commits","review_comments_url":"https://api.github.com/repos/playframework/playframework/pulls/8639/comments","review_comment_url":"https://api.github.com/repos/playframework/playframework/pulls/comments{/number}","comments_url":"https://api.github.com/repos/playframework/playframework/issues/8639/comments","statuses_url":"https://api.github.com/repos/playframework/playframework/statuses/3399344164373b5a9e6d89840d6db5d3ee2ab56d","head":{"label":"mkurz:passRequest","ref":"passRequest","sha":"3399344164373b5a9e6d89840d6db5d3ee2ab56d","user":{"login":"mkurz","id":644927,"node_id":"MDQ6VXNlcjY0NDkyNw==","avatar_url":"https://avatars2.githubusercontent.com/u/644927?v=4","gravatar_id":"","url":"https://api.github.com/users/mkurz","html_url":"https://github.com/mkurz","followers_url":"https://api.github.com/users/mkurz/followers","following_url":"https://api.github.com/users/mkurz/following{/other_user}","gists_url":"https://api.github.com/users/mkurz/gists{/gist_id}","starred_url":"https://api.github.com/users/mkurz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkurz/subscriptions","organizations_url":"https://api.github.com/users/mkurz/orgs","repos_url":"https://api.github.com/users/mkurz/repos","events_url":"https://api.github.com/users/mkurz/events{/privacy}","received_events_url":"https://api.github.com/users/mkurz/received_events","type":"User","site_admin":false},"repo":{"id":17720374,"node_id":"MDEwOlJlcG9zaXRvcnkxNzcyMDM3NA==","name":"playframework","full_name":"mkurz/playframework","private":false,"owner":{"login":"mkurz","id":644927,"node_id":"MDQ6VXNlcjY0NDkyNw==","avatar_url":"https://avatars2.githubusercontent.com/u/644927?v=4","gravatar_id":"","url":"https://api.github.com/users/mkurz","html_url":"https://github.com/mkurz","followers_url":"https://api.github.com/users/mkurz/followers","following_url":"https://api.github.com/users/mkurz/following{/other_user}","gists_url":"https://api.github.com/users/mkurz/gists{/gist_id}","starred_url":"https://api.github.com/users/mkurz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkurz/subscriptions","organizations_url":"https://api.github.com/users/mkurz/orgs","repos_url":"https://api.github.com/users/mkurz/repos","events_url":"https://api.github.com/users/mkurz/events{/privacy}","received_events_url":"https://api.github.com/users/mkurz/received_events","type":"User","site_admin":false},"html_url":"https://github.com/mkurz/playframework","description":"Play Framework","fork":true,"url":"https://api.github.com/repos/mkurz/playframework","forks_url":"https://api.github.com/repos/mkurz/playframework/forks","keys_url":"https://api.github.com/repos/mkurz/playframework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mkurz/playframework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mkurz/playframework/teams","hooks_url":"https://api.github.com/repos/mkurz/playframework/hooks","issue_events_url":"https://api.github.com/repos/mkurz/playframework/issues/events{/number}","events_url":"https://api.github.com/repos/mkurz/playframework/events","assignees_url":"https://api.github.com/repos/mkurz/playframework/assignees{/user}","branches_url":"https://api.github.com/repos/mkurz/playframework/branches{/branch}","tags_url":"https://api.github.com/repos/mkurz/playframework/tags","blobs_url":"https://api.github.com/repos/mkurz/playframework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mkurz/playframework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mkurz/playframework/git/refs{/sha}","trees_url":"https://api.github.com/repos/mkurz/playframework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mkurz/playframework/statuses/{sha}","languages_url":"https://api.github.com/repos/mkurz/playframework/languages","stargazers_url":"https://api.github.com/repos/mkurz/playframework/stargazers","contributors_url":"https://api.github.com/repos/mkurz/playframework/contributors","subscribers_url":"https://api.github.com/repos/mkurz/playframework/subscribers","subscription_url":"https://api.github.com/repos/mkurz/playframework/subscription","commits_url":"https://api.github.com/repos/mkurz/playframework/commits{/sha}","git_commits_url":"https://api.github.com/repos/mkurz/playframework/git/commits{/sha}","comments_url":"https://api.github.com/repos/mkurz/playframework/comments{/number}","issue_comment_url":"https://api.github.com/repos/mkurz/playframework/issues/comments{/number}","contents_url":"https://api.github.com/repos/mkurz/playframework/contents/{+path}","compare_url":"https://api.github.com/repos/mkurz/playframework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mkurz/playframework/merges","archive_url":"https://api.github.com/repos/mkurz/playframework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mkurz/playframework/downloads","issues_url":"https://api.github.com/repos/mkurz/playframework/issues{/number}","pulls_url":"https://api.github.com/repos/mkurz/playframework/pulls{/number}","milestones_url":"https://api.github.com/repos/mkurz/playframework/milestones{/number}","notifications_url":"https://api.github.com/repos/mkurz/playframework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mkurz/playframework/labels{/name}","releases_url":"https://api.github.com/repos/mkurz/playframework/releases{/id}","deployments_url":"https://api.github.com/repos/mkurz/playframework/deployments","created_at":"2014-03-13T17:52:40Z","updated_at":"2018-10-09T09:47:19Z","pushed_at":"2018-10-11T20:58:26Z","git_url":"git://github.com/mkurz/playframework.git","ssh_url":"git@github.com:mkurz/playframework.git","clone_url":"https://github.com/mkurz/playframework.git","svn_url":"https://github.com/mkurz/playframework","homepage":"http://www.playframework.com/","size":89528,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"playframework:master","ref":"master","sha":"f38e65a2e95e61883069a8cee170e72a2a873668","user":{"login":"playframework","id":319107,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxOTEwNw==","avatar_url":"https://avatars0.githubusercontent.com/u/319107?v=4","gravatar_id":"","url":"https://api.github.com/users/playframework","html_url":"https://github.com/playframework","followers_url":"https://api.github.com/users/playframework/followers","following_url":"https://api.github.com/users/playframework/following{/other_user}","gists_url":"https://api.github.com/users/playframework/gists{/gist_id}","starred_url":"https://api.github.com/users/playframework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/playframework/subscriptions","organizations_url":"https://api.github.com/users/playframework/orgs","repos_url":"https://api.github.com/users/playframework/repos","events_url":"https://api.github.com/users/playframework/events{/privacy}","received_events_url":"https://api.github.com/users/playframework/received_events","type":"Organization","site_admin":false},"repo":{"id":2340549,"node_id":"MDEwOlJlcG9zaXRvcnkyMzQwNTQ5","name":"playframework","full_name":"playframework/playframework","private":false,"owner":{"login":"playframework","id":319107,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxOTEwNw==","avatar_url":"https://avatars0.githubusercontent.com/u/319107?v=4","gravatar_id":"","url":"https://api.github.com/users/playframework","html_url":"https://github.com/playframework","followers_url":"https://api.github.com/users/playframework/followers","following_url":"https://api.github.com/users/playframework/following{/other_user}","gists_url":"https://api.github.com/users/playframework/gists{/gist_id}","starred_url":"https://api.github.com/users/playframework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/playframework/subscriptions","organizations_url":"https://api.github.com/users/playframework/orgs","repos_url":"https://api.github.com/users/playframework/repos","events_url":"https://api.github.com/users/playframework/events{/privacy}","received_events_url":"https://api.github.com/users/playframework/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/playframework/playframework","description":"Play Framework","fork":false,"url":"https://api.github.com/repos/playframework/playframework","forks_url":"https://api.github.com/repos/playframework/playframework/forks","keys_url":"https://api.github.com/repos/playframework/playframework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/playframework/playframework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/playframework/playframework/teams","hooks_url":"https://api.github.com/repos/playframework/playframework/hooks","issue_events_url":"https://api.github.com/repos/playframework/playframework/issues/events{/number}","events_url":"https://api.github.com/repos/playframework/playframework/events","assignees_url":"https://api.github.com/repos/playframework/playframework/assignees{/user}","branches_url":"https://api.github.com/repos/playframework/playframework/branches{/branch}","tags_url":"https://api.github.com/repos/playframework/playframework/tags","blobs_url":"https://api.github.com/repos/playframework/playframework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/playframework/playframework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/playframework/playframework/git/refs{/sha}","trees_url":"https://api.github.com/repos/playframework/playframework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/playframework/playframework/statuses/{sha}","languages_url":"https://api.github.com/repos/playframework/playframework/languages","stargazers_url":"https://api.github.com/repos/playframework/playframework/stargazers","contributors_url":"https://api.github.com/repos/playframework/playframework/contributors","subscribers_url":"https://api.github.com/repos/playframework/playframework/subscribers","subscription_url":"https://api.github.com/repos/playframework/playframework/subscription","commits_url":"https://api.github.com/repos/playframework/playframework/commits{/sha}","git_commits_url":"https://api.github.com/repos/playframework/playframework/git/commits{/sha}","comments_url":"https://api.github.com/repos/playframework/playframework/comments{/number}","issue_comment_url":"https://api.github.com/repos/playframework/playframework/issues/comments{/number}","contents_url":"https://api.github.com/repos/playframework/playframework/contents/{+path}","compare_url":"https://api.github.com/repos/playframework/playframework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/playframework/playframework/merges","archive_url":"https://api.github.com/repos/playframework/playframework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/playframework/playframework/downloads","issues_url":"https://api.github.com/repos/playframework/playframework/issues{/number}","pulls_url":"https://api.github.com/repos/playframework/playframework/pulls{/number}","milestones_url":"https://api.github.com/repos/playframework/playframework/milestones{/number}","notifications_url":"https://api.github.com/repos/playframework/playframework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/playframework/playframework/labels{/name}","releases_url":"https://api.github.com/repos/playframework/playframework/releases{/id}","deployments_url":"https://api.github.com/repos/playframework/playframework/deployments","created_at":"2011-09-07T09:24:08Z","updated_at":"2018-10-11T19:05:22Z","pushed_at":"2018-10-11T20:58:29Z","git_url":"git://github.com/playframework/playframework.git","ssh_url":"git@github.com:playframework/playframework.git","clone_url":"https://github.com/playframework/playframework.git","svn_url":"https://github.com/playframework/playframework","homepage":"http://www.playframework.com/","size":90929,"stargazers_count":10754,"watchers_count":10754,"language":"Scala","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3634,"mirror_url":null,"archived":false,"open_issues_count":392,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":3634,"open_issues":392,"watchers":10754,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/playframework/playframework/pulls/8639"},"html":{"href":"https://github.com/playframework/playframework/pull/8639"},"issue":{"href":"https://api.github.com/repos/playframework/playframework/issues/8639"},"comments":{"href":"https://api.github.com/repos/playframework/playframework/issues/8639/comments"},"review_comments":{"href":"https://api.github.com/repos/playframework/playframework/pulls/8639/comments"},"review_comment":{"href":"https://api.github.com/repos/playframework/playframework/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/playframework/playframework/pulls/8639/commits"},"statuses":{"href":"https://api.github.com/repos/playframework/playframework/statuses/3399344164373b5a9e6d89840d6db5d3ee2ab56d"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"mkurz"}}