{"action":"created","comment":{"url":"https://api.github.com/repos/qutheory/vapor/pulls/comments/63755444","id":63755444,"diff_hunk":"@@ -1,20 +1,114 @@\n+import MediaType\n+\n public protocol RequestContentSubscript {}\n \n extension String: RequestContentSubscript { }\n extension Int: RequestContentSubscript {}\n \n public extension Request {\n \n+    public enum MultiPart: Node {\n+        case files([(name: String?, type: MediaType?, data: Data)])\n+        case file(name: String?, type: MediaType?, data: Data)\n+        case input(String)\n+        \n+        public var file: (name: String?, type: MediaType?, data: Data)? {\n+            if case .file(let name, let media, let data) = self {\n+                return (name, media, data)\n+            }\n+\n+            return nil\n+        }\n+\n+        public var files: [(name: String?, type: MediaType?, data: Data)]? {\n+            if case .files(let files) = self {\n+                return files\n+            }\n+\n+            return nil\n+        }\n+\n+        public var input: String? {\n+            if case .input(let string) = self {\n+                return string\n+            }\n+\n+            return nil\n+        }\n+        \n+        public var isNull: Bool {\n+            return self.input == \"null\"\n+        }\n+        \n+        public var bool: Bool? {\n+            if case .input(let bool) = self {\n+                return Bool(bool)\n+            }\n+            \n+            return nil\n+        }\n+        \n+        public var int: Int? {\n+            guard let double = double else { return nil }\n+            return Int(double)\n+        }\n+        \n+        public var uint: UInt? {\n+            guard let double = double else { return nil }\n+            return UInt(double)\n+        }\n+        \n+        public var float: Float? {\n+            guard let double = double else { return nil }\n+            return Float(double)\n+        }\n+        \n+        public var double: Double? {\n+            if case .input(let d) = self {\n+                return Double(d)\n+            }\n+            \n+            return nil\n+        }\n+        \n+        public var string: String? {\n+            return self.input\n+        }\n+        \n+        public var array: [Node]? {\n+            guard case .input(let a) = self else {\n+                return nil\n+            }\n+            \n+            return [a]\n+//            return self\n+//                .split(byString: \",\")\n+//                .map { $0 as Node }\n+        }\n+        ","path":"Sources/Vapor/Request/RequestContent.swift","position":88,"original_position":88,"commit_id":"99d2d70264d60e2a1b6cc2c24b1b62ba051d908d","original_commit_id":"99d2d70264d60e2a1b6cc2c24b1b62ba051d908d","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)","created_at":"2016-05-18T18:23:07Z","updated_at":"2016-05-18T18:23:07Z","html_url":"https://github.com/qutheory/vapor/pull/281#discussion_r63755444","pull_request_url":"https://api.github.com/repos/qutheory/vapor/pulls/281","_links":{"self":{"href":"https://api.github.com/repos/qutheory/vapor/pulls/comments/63755444"},"html":{"href":"https://github.com/qutheory/vapor/pull/281#discussion_r63755444"},"pull_request":{"href":"https://api.github.com/repos/qutheory/vapor/pulls/281"}}},"pull_request":{"url":"https://api.github.com/repos/qutheory/vapor/pulls/281","id":70444636,"html_url":"https://github.com/qutheory/vapor/pull/281","diff_url":"https://github.com/qutheory/vapor/pull/281.diff","patch_url":"https://github.com/qutheory/vapor/pull/281.patch","issue_url":"https://api.github.com/repos/qutheory/vapor/issues/281","number":281,"state":"open","locked":false,"title":"multipart forms","user":{"login":"LoganWright","id":5750489,"avatar_url":"https://avatars.githubusercontent.com/u/5750489?v=3","gravatar_id":"","url":"https://api.github.com/users/LoganWright","html_url":"https://github.com/LoganWright","followers_url":"https://api.github.com/users/LoganWright/followers","following_url":"https://api.github.com/users/LoganWright/following{/other_user}","gists_url":"https://api.github.com/users/LoganWright/gists{/gist_id}","starred_url":"https://api.github.com/users/LoganWright/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LoganWright/subscriptions","organizations_url":"https://api.github.com/users/LoganWright/orgs","repos_url":"https://api.github.com/users/LoganWright/repos","events_url":"https://api.github.com/users/LoganWright/events{/privacy}","received_events_url":"https://api.github.com/users/LoganWright/received_events","type":"User","site_admin":false},"body":"Fixes #260","created_at":"2016-05-17T22:57:16Z","updated_at":"2016-05-18T18:23:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8b6d3dd608e226f4c121f0107a2c1217a89fb413","assignee":{"login":"Joannis","id":1951674,"avatar_url":"https://avatars.githubusercontent.com/u/1951674?v=3","gravatar_id":"","url":"https://api.github.com/users/Joannis","html_url":"https://github.com/Joannis","followers_url":"https://api.github.com/users/Joannis/followers","following_url":"https://api.github.com/users/Joannis/following{/other_user}","gists_url":"https://api.github.com/users/Joannis/gists{/gist_id}","starred_url":"https://api.github.com/users/Joannis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Joannis/subscriptions","organizations_url":"https://api.github.com/users/Joannis/orgs","repos_url":"https://api.github.com/users/Joannis/repos","events_url":"https://api.github.com/users/Joannis/events{/privacy}","received_events_url":"https://api.github.com/users/Joannis/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/qutheory/vapor/milestones/2","html_url":"https://github.com/qutheory/vapor/milestones/0.9","labels_url":"https://api.github.com/repos/qutheory/vapor/milestones/2/labels","id":1753200,"number":2,"title":"0.9","description":"","creator":{"login":"tannernelson","id":1342803,"avatar_url":"https://avatars.githubusercontent.com/u/1342803?v=3","gravatar_id":"","url":"https://api.github.com/users/tannernelson","html_url":"https://github.com/tannernelson","followers_url":"https://api.github.com/users/tannernelson/followers","following_url":"https://api.github.com/users/tannernelson/following{/other_user}","gists_url":"https://api.github.com/users/tannernelson/gists{/gist_id}","starred_url":"https://api.github.com/users/tannernelson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tannernelson/subscriptions","organizations_url":"https://api.github.com/users/tannernelson/orgs","repos_url":"https://api.github.com/users/tannernelson/repos","events_url":"https://api.github.com/users/tannernelson/events{/privacy}","received_events_url":"https://api.github.com/users/tannernelson/received_events","type":"User","site_admin":false},"open_issues":10,"closed_issues":0,"state":"open","created_at":"2016-05-07T17:59:01Z","updated_at":"2016-05-18T16:31:02Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/qutheory/vapor/pulls/281/commits","review_comments_url":"https://api.github.com/repos/qutheory/vapor/pulls/281/comments","review_comment_url":"https://api.github.com/repos/qutheory/vapor/pulls/comments{/number}","comments_url":"https://api.github.com/repos/qutheory/vapor/issues/281/comments","statuses_url":"https://api.github.com/repos/qutheory/vapor/statuses/99d2d70264d60e2a1b6cc2c24b1b62ba051d908d","head":{"label":"qutheory:multipart-forms","ref":"multipart-forms","sha":"99d2d70264d60e2a1b6cc2c24b1b62ba051d908d","user":{"login":"qutheory","id":17364220,"avatar_url":"https://avatars.githubusercontent.com/u/17364220?v=3","gravatar_id":"","url":"https://api.github.com/users/qutheory","html_url":"https://github.com/qutheory","followers_url":"https://api.github.com/users/qutheory/followers","following_url":"https://api.github.com/users/qutheory/following{/other_user}","gists_url":"https://api.github.com/users/qutheory/gists{/gist_id}","starred_url":"https://api.github.com/users/qutheory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qutheory/subscriptions","organizations_url":"https://api.github.com/users/qutheory/orgs","repos_url":"https://api.github.com/users/qutheory/repos","events_url":"https://api.github.com/users/qutheory/events{/privacy}","received_events_url":"https://api.github.com/users/qutheory/received_events","type":"Organization","site_admin":false},"repo":{"id":49910095,"name":"vapor","full_name":"qutheory/vapor","owner":{"login":"qutheory","id":17364220,"avatar_url":"https://avatars.githubusercontent.com/u/17364220?v=3","gravatar_id":"","url":"https://api.github.com/users/qutheory","html_url":"https://github.com/qutheory","followers_url":"https://api.github.com/users/qutheory/followers","following_url":"https://api.github.com/users/qutheory/following{/other_user}","gists_url":"https://api.github.com/users/qutheory/gists{/gist_id}","starred_url":"https://api.github.com/users/qutheory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qutheory/subscriptions","organizations_url":"https://api.github.com/users/qutheory/orgs","repos_url":"https://api.github.com/users/qutheory/repos","events_url":"https://api.github.com/users/qutheory/events{/privacy}","received_events_url":"https://api.github.com/users/qutheory/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/qutheory/vapor","description":"An elegant web framework for Swift that works on OS X and Ubuntu.","fork":false,"url":"https://api.github.com/repos/qutheory/vapor","forks_url":"https://api.github.com/repos/qutheory/vapor/forks","keys_url":"https://api.github.com/repos/qutheory/vapor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/qutheory/vapor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/qutheory/vapor/teams","hooks_url":"https://api.github.com/repos/qutheory/vapor/hooks","issue_events_url":"https://api.github.com/repos/qutheory/vapor/issues/events{/number}","events_url":"https://api.github.com/repos/qutheory/vapor/events","assignees_url":"https://api.github.com/repos/qutheory/vapor/assignees{/user}","branches_url":"https://api.github.com/repos/qutheory/vapor/branches{/branch}","tags_url":"https://api.github.com/repos/qutheory/vapor/tags","blobs_url":"https://api.github.com/repos/qutheory/vapor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/qutheory/vapor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/qutheory/vapor/git/refs{/sha}","trees_url":"https://api.github.com/repos/qutheory/vapor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/qutheory/vapor/statuses/{sha}","languages_url":"https://api.github.com/repos/qutheory/vapor/languages","stargazers_url":"https://api.github.com/repos/qutheory/vapor/stargazers","contributors_url":"https://api.github.com/repos/qutheory/vapor/contributors","subscribers_url":"https://api.github.com/repos/qutheory/vapor/subscribers","subscription_url":"https://api.github.com/repos/qutheory/vapor/subscription","commits_url":"https://api.github.com/repos/qutheory/vapor/commits{/sha}","git_commits_url":"https://api.github.com/repos/qutheory/vapor/git/commits{/sha}","comments_url":"https://api.github.com/repos/qutheory/vapor/comments{/number}","issue_comment_url":"https://api.github.com/repos/qutheory/vapor/issues/comments{/number}","contents_url":"https://api.github.com/repos/qutheory/vapor/contents/{+path}","compare_url":"https://api.github.com/repos/qutheory/vapor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/qutheory/vapor/merges","archive_url":"https://api.github.com/repos/qutheory/vapor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/qutheory/vapor/downloads","issues_url":"https://api.github.com/repos/qutheory/vapor/issues{/number}","pulls_url":"https://api.github.com/repos/qutheory/vapor/pulls{/number}","milestones_url":"https://api.github.com/repos/qutheory/vapor/milestones{/number}","notifications_url":"https://api.github.com/repos/qutheory/vapor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/qutheory/vapor/labels{/name}","releases_url":"https://api.github.com/repos/qutheory/vapor/releases{/id}","deployments_url":"https://api.github.com/repos/qutheory/vapor/deployments","created_at":"2016-01-18T22:37:52Z","updated_at":"2016-05-18T18:13:53Z","pushed_at":"2016-05-18T18:22:54Z","git_url":"git://github.com/qutheory/vapor.git","ssh_url":"git@github.com:qutheory/vapor.git","clone_url":"https://github.com/qutheory/vapor.git","svn_url":"https://github.com/qutheory/vapor","homepage":"qutheory.io","size":6767,"stargazers_count":3848,"watchers_count":3848,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":201,"mirror_url":null,"open_issues_count":36,"forks":201,"open_issues":36,"watchers":3848,"default_branch":"master"}},"base":{"label":"qutheory:master","ref":"master","sha":"655ad9c46996bf6b12704bf2ecf7064f8beab0d8","user":{"login":"qutheory","id":17364220,"avatar_url":"https://avatars.githubusercontent.com/u/17364220?v=3","gravatar_id":"","url":"https://api.github.com/users/qutheory","html_url":"https://github.com/qutheory","followers_url":"https://api.github.com/users/qutheory/followers","following_url":"https://api.github.com/users/qutheory/following{/other_user}","gists_url":"https://api.github.com/users/qutheory/gists{/gist_id}","starred_url":"https://api.github.com/users/qutheory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qutheory/subscriptions","organizations_url":"https://api.github.com/users/qutheory/orgs","repos_url":"https://api.github.com/users/qutheory/repos","events_url":"https://api.github.com/users/qutheory/events{/privacy}","received_events_url":"https://api.github.com/users/qutheory/received_events","type":"Organization","site_admin":false},"repo":{"id":49910095,"name":"vapor","full_name":"qutheory/vapor","owner":{"login":"qutheory","id":17364220,"avatar_url":"https://avatars.githubusercontent.com/u/17364220?v=3","gravatar_id":"","url":"https://api.github.com/users/qutheory","html_url":"https://github.com/qutheory","followers_url":"https://api.github.com/users/qutheory/followers","following_url":"https://api.github.com/users/qutheory/following{/other_user}","gists_url":"https://api.github.com/users/qutheory/gists{/gist_id}","starred_url":"https://api.github.com/users/qutheory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qutheory/subscriptions","organizations_url":"https://api.github.com/users/qutheory/orgs","repos_url":"https://api.github.com/users/qutheory/repos","events_url":"https://api.github.com/users/qutheory/events{/privacy}","received_events_url":"https://api.github.com/users/qutheory/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/qutheory/vapor","description":"An elegant web framework for Swift that works on OS X and Ubuntu.","fork":false,"url":"https://api.github.com/repos/qutheory/vapor","forks_url":"https://api.github.com/repos/qutheory/vapor/forks","keys_url":"https://api.github.com/repos/qutheory/vapor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/qutheory/vapor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/qutheory/vapor/teams","hooks_url":"https://api.github.com/repos/qutheory/vapor/hooks","issue_events_url":"https://api.github.com/repos/qutheory/vapor/issues/events{/number}","events_url":"https://api.github.com/repos/qutheory/vapor/events","assignees_url":"https://api.github.com/repos/qutheory/vapor/assignees{/user}","branches_url":"https://api.github.com/repos/qutheory/vapor/branches{/branch}","tags_url":"https://api.github.com/repos/qutheory/vapor/tags","blobs_url":"https://api.github.com/repos/qutheory/vapor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/qutheory/vapor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/qutheory/vapor/git/refs{/sha}","trees_url":"https://api.github.com/repos/qutheory/vapor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/qutheory/vapor/statuses/{sha}","languages_url":"https://api.github.com/repos/qutheory/vapor/languages","stargazers_url":"https://api.github.com/repos/qutheory/vapor/stargazers","contributors_url":"https://api.github.com/repos/qutheory/vapor/contributors","subscribers_url":"https://api.github.com/repos/qutheory/vapor/subscribers","subscription_url":"https://api.github.com/repos/qutheory/vapor/subscription","commits_url":"https://api.github.com/repos/qutheory/vapor/commits{/sha}","git_commits_url":"https://api.github.com/repos/qutheory/vapor/git/commits{/sha}","comments_url":"https://api.github.com/repos/qutheory/vapor/comments{/number}","issue_comment_url":"https://api.github.com/repos/qutheory/vapor/issues/comments{/number}","contents_url":"https://api.github.com/repos/qutheory/vapor/contents/{+path}","compare_url":"https://api.github.com/repos/qutheory/vapor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/qutheory/vapor/merges","archive_url":"https://api.github.com/repos/qutheory/vapor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/qutheory/vapor/downloads","issues_url":"https://api.github.com/repos/qutheory/vapor/issues{/number}","pulls_url":"https://api.github.com/repos/qutheory/vapor/pulls{/number}","milestones_url":"https://api.github.com/repos/qutheory/vapor/milestones{/number}","notifications_url":"https://api.github.com/repos/qutheory/vapor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/qutheory/vapor/labels{/name}","releases_url":"https://api.github.com/repos/qutheory/vapor/releases{/id}","deployments_url":"https://api.github.com/repos/qutheory/vapor/deployments","created_at":"2016-01-18T22:37:52Z","updated_at":"2016-05-18T18:13:53Z","pushed_at":"2016-05-18T18:22:54Z","git_url":"git://github.com/qutheory/vapor.git","ssh_url":"git@github.com:qutheory/vapor.git","clone_url":"https://github.com/qutheory/vapor.git","svn_url":"https://github.com/qutheory/vapor","homepage":"qutheory.io","size":6767,"stargazers_count":3848,"watchers_count":3848,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":201,"mirror_url":null,"open_issues_count":36,"forks":201,"open_issues":36,"watchers":3848,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/qutheory/vapor/pulls/281"},"html":{"href":"https://github.com/qutheory/vapor/pull/281"},"issue":{"href":"https://api.github.com/repos/qutheory/vapor/issues/281"},"comments":{"href":"https://api.github.com/repos/qutheory/vapor/issues/281/comments"},"review_comments":{"href":"https://api.github.com/repos/qutheory/vapor/pulls/281/comments"},"review_comment":{"href":"https://api.github.com/repos/qutheory/vapor/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/qutheory/vapor/pulls/281/commits"},"statuses":{"href":"https://api.github.com/repos/qutheory/vapor/statuses/99d2d70264d60e2a1b6cc2c24b1b62ba051d908d"}}}}