{"action":"created","comment":{"url":"https://api.github.com/repos/akka/akka/pulls/comments/46096801","id":46096801,"diff_hunk":"@@ -40,6 +59,50 @@ trait FormFieldDirectives extends ToNameReceptacleEnhancements {\n }\n \n object FormFieldDirectives extends FormFieldDirectives {\n+\n+  val _formFieldSeq: Directive1[immutable.Seq[(String, String)]] = {\n+    import BasicDirectives._\n+    import FutureDirectives._\n+    import akka.http.scaladsl.unmarshalling._\n+\n+    extract { ctx ⇒\n+      import ctx.{ executionContext, materializer }\n+      Unmarshal(ctx.request.entity).to[StrictForm].fast.flatMap { form ⇒\n+        val fields = form.fields.collect {\n+          case (name, field) if name.nonEmpty ⇒\n+            Unmarshal(field).to[String].map(fieldString ⇒ (name, fieldString))","path":"akka-http/src/main/scala/akka/http/scaladsl/server/directives/FormFieldDirectives.scala","position":56,"original_position":56,"commit_id":"c20063da364d475f2b98d722b1b51301a279b364","original_commit_id":"c20063da364d475f2b98d722b1b51301a279b364","user":{"login":"ktoso","id":120979,"avatar_url":"https://avatars.githubusercontent.com/u/120979?v=3","gravatar_id":"","url":"https://api.github.com/users/ktoso","html_url":"https://github.com/ktoso","followers_url":"https://api.github.com/users/ktoso/followers","following_url":"https://api.github.com/users/ktoso/following{/other_user}","gists_url":"https://api.github.com/users/ktoso/gists{/gist_id}","starred_url":"https://api.github.com/users/ktoso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ktoso/subscriptions","organizations_url":"https://api.github.com/users/ktoso/orgs","repos_url":"https://api.github.com/users/ktoso/repos","events_url":"https://api.github.com/users/ktoso/events{/privacy}","received_events_url":"https://api.github.com/users/ktoso/received_events","type":"User","site_admin":false},"body":"Now that I see it, this directive implies we'll try to toStrict all parts of the FormData...\r\nI'd like to avoid attempting this for all fields - since one of them may be a \"very big thing\" (i.e. file upload, in the \"file\" form field). Making it `formFieldSeq(\"bla\", \"bla2\")` makes it more explicit, but doesn't really solve the problem. I currently don't have an idea how to address my above worry – should we don't worry about it but document these semantics explicitly, or not provide such directive - WDYT @sirthias @jrudolph ?","created_at":"2015-11-29T19:36:07Z","updated_at":"2015-11-29T19:36:07Z","html_url":"https://github.com/akka/akka/pull/19042#discussion_r46096801","pull_request_url":"https://api.github.com/repos/akka/akka/pulls/19042","_links":{"self":{"href":"https://api.github.com/repos/akka/akka/pulls/comments/46096801"},"html":{"href":"https://github.com/akka/akka/pull/19042#discussion_r46096801"},"pull_request":{"href":"https://api.github.com/repos/akka/akka/pulls/19042"}}},"pull_request":{"url":"https://api.github.com/repos/akka/akka/pulls/19042","id":52063984,"html_url":"https://github.com/akka/akka/pull/19042","diff_url":"https://github.com/akka/akka/pull/19042.diff","patch_url":"https://github.com/akka/akka/pull/19042.patch","issue_url":"https://api.github.com/repos/akka/akka/issues/19042","number":19042,"state":"open","locked":false,"title":"[WIP] Add formFieldMap, formFieldMultiMap & formFieldSeq Directives","user":{"login":"wjur","id":924886,"avatar_url":"https://avatars.githubusercontent.com/u/924886?v=3","gravatar_id":"","url":"https://api.github.com/users/wjur","html_url":"https://github.com/wjur","followers_url":"https://api.github.com/users/wjur/followers","following_url":"https://api.github.com/users/wjur/following{/other_user}","gists_url":"https://api.github.com/users/wjur/gists{/gist_id}","starred_url":"https://api.github.com/users/wjur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wjur/subscriptions","organizations_url":"https://api.github.com/users/wjur/orgs","repos_url":"https://api.github.com/users/wjur/repos","events_url":"https://api.github.com/users/wjur/events{/privacy}","received_events_url":"https://api.github.com/users/wjur/received_events","type":"User","site_admin":false},"body":"This PR includes formFieldMap, formFieldMultiMap and formFieldSeq Directives. Fixes #16651.\r\nThe work is still in progress as I faced a question I couldn't answer myself: what are the correct rejections for the directives? In FormFieldDirectives.formFieldSeq I need to handle exceptions and produce correct rejections. I'm not sure how to find the possible exceptions (and thus correct rejections). Probably, it's necessary to create a new rejection called 'MalformedFormRejection' (as an analogy to 'MalformedFormFieldRejection'). May I ask for some guidance in this topic, @ktoso?\r\n\r\n","created_at":"2015-11-29T15:32:35Z","updated_at":"2015-11-29T19:36:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"958f6d83c290d00241c4d1667f35267515d5f40a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/akka/akka/pulls/19042/commits","review_comments_url":"https://api.github.com/repos/akka/akka/pulls/19042/comments","review_comment_url":"https://api.github.com/repos/akka/akka/pulls/comments{/number}","comments_url":"https://api.github.com/repos/akka/akka/issues/19042/comments","statuses_url":"https://api.github.com/repos/akka/akka/statuses/c20063da364d475f2b98d722b1b51301a279b364","head":{"label":"wjur:wjur/16651_form_fields","ref":"wjur/16651_form_fields","sha":"c20063da364d475f2b98d722b1b51301a279b364","user":{"login":"wjur","id":924886,"avatar_url":"https://avatars.githubusercontent.com/u/924886?v=3","gravatar_id":"","url":"https://api.github.com/users/wjur","html_url":"https://github.com/wjur","followers_url":"https://api.github.com/users/wjur/followers","following_url":"https://api.github.com/users/wjur/following{/other_user}","gists_url":"https://api.github.com/users/wjur/gists{/gist_id}","starred_url":"https://api.github.com/users/wjur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wjur/subscriptions","organizations_url":"https://api.github.com/users/wjur/orgs","repos_url":"https://api.github.com/users/wjur/repos","events_url":"https://api.github.com/users/wjur/events{/privacy}","received_events_url":"https://api.github.com/users/wjur/received_events","type":"User","site_admin":false},"repo":{"id":32477434,"name":"akka","full_name":"wjur/akka","owner":{"login":"wjur","id":924886,"avatar_url":"https://avatars.githubusercontent.com/u/924886?v=3","gravatar_id":"","url":"https://api.github.com/users/wjur","html_url":"https://github.com/wjur","followers_url":"https://api.github.com/users/wjur/followers","following_url":"https://api.github.com/users/wjur/following{/other_user}","gists_url":"https://api.github.com/users/wjur/gists{/gist_id}","starred_url":"https://api.github.com/users/wjur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wjur/subscriptions","organizations_url":"https://api.github.com/users/wjur/orgs","repos_url":"https://api.github.com/users/wjur/repos","events_url":"https://api.github.com/users/wjur/events{/privacy}","received_events_url":"https://api.github.com/users/wjur/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wjur/akka","description":"Akka Project","fork":true,"url":"https://api.github.com/repos/wjur/akka","forks_url":"https://api.github.com/repos/wjur/akka/forks","keys_url":"https://api.github.com/repos/wjur/akka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wjur/akka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wjur/akka/teams","hooks_url":"https://api.github.com/repos/wjur/akka/hooks","issue_events_url":"https://api.github.com/repos/wjur/akka/issues/events{/number}","events_url":"https://api.github.com/repos/wjur/akka/events","assignees_url":"https://api.github.com/repos/wjur/akka/assignees{/user}","branches_url":"https://api.github.com/repos/wjur/akka/branches{/branch}","tags_url":"https://api.github.com/repos/wjur/akka/tags","blobs_url":"https://api.github.com/repos/wjur/akka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wjur/akka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wjur/akka/git/refs{/sha}","trees_url":"https://api.github.com/repos/wjur/akka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wjur/akka/statuses/{sha}","languages_url":"https://api.github.com/repos/wjur/akka/languages","stargazers_url":"https://api.github.com/repos/wjur/akka/stargazers","contributors_url":"https://api.github.com/repos/wjur/akka/contributors","subscribers_url":"https://api.github.com/repos/wjur/akka/subscribers","subscription_url":"https://api.github.com/repos/wjur/akka/subscription","commits_url":"https://api.github.com/repos/wjur/akka/commits{/sha}","git_commits_url":"https://api.github.com/repos/wjur/akka/git/commits{/sha}","comments_url":"https://api.github.com/repos/wjur/akka/comments{/number}","issue_comment_url":"https://api.github.com/repos/wjur/akka/issues/comments{/number}","contents_url":"https://api.github.com/repos/wjur/akka/contents/{+path}","compare_url":"https://api.github.com/repos/wjur/akka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wjur/akka/merges","archive_url":"https://api.github.com/repos/wjur/akka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wjur/akka/downloads","issues_url":"https://api.github.com/repos/wjur/akka/issues{/number}","pulls_url":"https://api.github.com/repos/wjur/akka/pulls{/number}","milestones_url":"https://api.github.com/repos/wjur/akka/milestones{/number}","notifications_url":"https://api.github.com/repos/wjur/akka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wjur/akka/labels{/name}","releases_url":"https://api.github.com/repos/wjur/akka/releases{/id}","created_at":"2015-03-18T18:39:58Z","updated_at":"2015-03-18T18:40:05Z","pushed_at":"2015-11-29T15:18:21Z","git_url":"git://github.com/wjur/akka.git","ssh_url":"git@github.com:wjur/akka.git","clone_url":"https://github.com/wjur/akka.git","svn_url":"https://github.com/wjur/akka","homepage":"http://akka.io","size":165772,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"akka:release-2.3-dev","ref":"release-2.3-dev","sha":"fb533d0e5dc5c8ba55a84756753727a62ff7ac43","user":{"login":"akka","id":1496237,"avatar_url":"https://avatars.githubusercontent.com/u/1496237?v=3","gravatar_id":"","url":"https://api.github.com/users/akka","html_url":"https://github.com/akka","followers_url":"https://api.github.com/users/akka/followers","following_url":"https://api.github.com/users/akka/following{/other_user}","gists_url":"https://api.github.com/users/akka/gists{/gist_id}","starred_url":"https://api.github.com/users/akka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akka/subscriptions","organizations_url":"https://api.github.com/users/akka/orgs","repos_url":"https://api.github.com/users/akka/repos","events_url":"https://api.github.com/users/akka/events{/privacy}","received_events_url":"https://api.github.com/users/akka/received_events","type":"Organization","site_admin":false},"repo":{"id":130013,"name":"akka","full_name":"akka/akka","owner":{"login":"akka","id":1496237,"avatar_url":"https://avatars.githubusercontent.com/u/1496237?v=3","gravatar_id":"","url":"https://api.github.com/users/akka","html_url":"https://github.com/akka","followers_url":"https://api.github.com/users/akka/followers","following_url":"https://api.github.com/users/akka/following{/other_user}","gists_url":"https://api.github.com/users/akka/gists{/gist_id}","starred_url":"https://api.github.com/users/akka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akka/subscriptions","organizations_url":"https://api.github.com/users/akka/orgs","repos_url":"https://api.github.com/users/akka/repos","events_url":"https://api.github.com/users/akka/events{/privacy}","received_events_url":"https://api.github.com/users/akka/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/akka/akka","description":"Akka Project","fork":false,"url":"https://api.github.com/repos/akka/akka","forks_url":"https://api.github.com/repos/akka/akka/forks","keys_url":"https://api.github.com/repos/akka/akka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/akka/akka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/akka/akka/teams","hooks_url":"https://api.github.com/repos/akka/akka/hooks","issue_events_url":"https://api.github.com/repos/akka/akka/issues/events{/number}","events_url":"https://api.github.com/repos/akka/akka/events","assignees_url":"https://api.github.com/repos/akka/akka/assignees{/user}","branches_url":"https://api.github.com/repos/akka/akka/branches{/branch}","tags_url":"https://api.github.com/repos/akka/akka/tags","blobs_url":"https://api.github.com/repos/akka/akka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/akka/akka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/akka/akka/git/refs{/sha}","trees_url":"https://api.github.com/repos/akka/akka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/akka/akka/statuses/{sha}","languages_url":"https://api.github.com/repos/akka/akka/languages","stargazers_url":"https://api.github.com/repos/akka/akka/stargazers","contributors_url":"https://api.github.com/repos/akka/akka/contributors","subscribers_url":"https://api.github.com/repos/akka/akka/subscribers","subscription_url":"https://api.github.com/repos/akka/akka/subscription","commits_url":"https://api.github.com/repos/akka/akka/commits{/sha}","git_commits_url":"https://api.github.com/repos/akka/akka/git/commits{/sha}","comments_url":"https://api.github.com/repos/akka/akka/comments{/number}","issue_comment_url":"https://api.github.com/repos/akka/akka/issues/comments{/number}","contents_url":"https://api.github.com/repos/akka/akka/contents/{+path}","compare_url":"https://api.github.com/repos/akka/akka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/akka/akka/merges","archive_url":"https://api.github.com/repos/akka/akka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/akka/akka/downloads","issues_url":"https://api.github.com/repos/akka/akka/issues{/number}","pulls_url":"https://api.github.com/repos/akka/akka/pulls{/number}","milestones_url":"https://api.github.com/repos/akka/akka/milestones{/number}","notifications_url":"https://api.github.com/repos/akka/akka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/akka/akka/labels{/name}","releases_url":"https://api.github.com/repos/akka/akka/releases{/id}","created_at":"2009-02-16T12:51:54Z","updated_at":"2015-11-29T16:48:59Z","pushed_at":"2015-11-29T15:32:35Z","git_url":"git://github.com/akka/akka.git","ssh_url":"git@github.com:akka/akka.git","clone_url":"https://github.com/akka/akka.git","svn_url":"https://github.com/akka/akka","homepage":"http://akka.io","size":177806,"stargazers_count":4762,"watchers_count":4762,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1429,"mirror_url":null,"open_issues_count":778,"forks":1429,"open_issues":778,"watchers":4762,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/akka/akka/pulls/19042"},"html":{"href":"https://github.com/akka/akka/pull/19042"},"issue":{"href":"https://api.github.com/repos/akka/akka/issues/19042"},"comments":{"href":"https://api.github.com/repos/akka/akka/issues/19042/comments"},"review_comments":{"href":"https://api.github.com/repos/akka/akka/pulls/19042/comments"},"review_comment":{"href":"https://api.github.com/repos/akka/akka/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/akka/akka/pulls/19042/commits"},"statuses":{"href":"https://api.github.com/repos/akka/akka/statuses/c20063da364d475f2b98d722b1b51301a279b364"}}}}