{"action":"created","comment":{"url":"https://api.github.com/repos/rejectedsoftware/vibe.d/pulls/comments/100200024","pull_request_review_id":20899658,"id":100200024,"diff_hunk":"@@ -765,12 +765,21 @@ final class HTTPServerRequest : HTTPRequest {\n \n \t\t/** Contains the parsed Json for a JSON request.\n \n-\t\t\tRemarks:\n-\t\t\t\tThis field is only set if HTTPServerOption.parseJsonBody is set.\n-\n-\t\t\t\tA JSON request must have the Content-Type \"application/json\" or \"application/vnd.api+json\".\n+\t\t\tA JSON request must have the Content-Type \"application/json\" or \"application/vnd.api+json\".\n \t\t*/\n-\t\tJson json;\n+\t\t@property ref const(Json) json() {\n+\t\t\tif (_json.isNull) {\n+\t\t\t\tif (icmp2(contentType, \"application/json\") == 0 || icmp2(contentType, \"application/vnd.api+json\") == 0 ) {\n+\t\t\t\t\tauto bodyStr = () @trusted { return cast(string) bodyReader.readAll(); } ();\n+\t\t\t\t\tif (!bodyStr.empty) _json = parseJson(bodyStr);\n+\t\t\t\t} else {\n+\t\t\t\t\t_json = Json.undefined;","path":"http/vibe/http/server.d","position":17,"original_position":17,"commit_id":"b72b49dd6791647a36b67e7a5fcabddf798989ad","original_commit_id":"b72b49dd6791647a36b67e7a5fcabddf798989ad","user":{"login":"wilzbach","id":4370550,"avatar_url":"https://avatars.githubusercontent.com/u/4370550?v=3","gravatar_id":"","url":"https://api.github.com/users/wilzbach","html_url":"https://github.com/wilzbach","followers_url":"https://api.github.com/users/wilzbach/followers","following_url":"https://api.github.com/users/wilzbach/following{/other_user}","gists_url":"https://api.github.com/users/wilzbach/gists{/gist_id}","starred_url":"https://api.github.com/users/wilzbach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilzbach/subscriptions","organizations_url":"https://api.github.com/users/wilzbach/orgs","repos_url":"https://api.github.com/users/wilzbach/repos","events_url":"https://api.github.com/users/wilzbach/events{/privacy}","received_events_url":"https://api.github.com/users/wilzbach/received_events","type":"User","site_admin":false},"body":"This is done to emulate the current behavior when no json content type is present.","created_at":"2017-02-08T23:43:57Z","updated_at":"2017-02-08T23:43:57Z","html_url":"https://github.com/rejectedsoftware/vibe.d/pull/1677#discussion_r100200024","pull_request_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/pulls/1677","_links":{"self":{"href":"https://api.github.com/repos/rejectedsoftware/vibe.d/pulls/comments/100200024"},"html":{"href":"https://github.com/rejectedsoftware/vibe.d/pull/1677#discussion_r100200024"},"pull_request":{"href":"https://api.github.com/repos/rejectedsoftware/vibe.d/pulls/1677"}}},"pull_request":{"url":"https://api.github.com/repos/rejectedsoftware/vibe.d/pulls/1677","id":105331016,"html_url":"https://github.com/rejectedsoftware/vibe.d/pull/1677","diff_url":"https://github.com/rejectedsoftware/vibe.d/pull/1677.diff","patch_url":"https://github.com/rejectedsoftware/vibe.d/pull/1677.patch","issue_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/issues/1677","number":1677,"state":"open","locked":false,"title":"Lazy initialization of req.json","user":{"login":"wilzbach","id":4370550,"avatar_url":"https://avatars.githubusercontent.com/u/4370550?v=3","gravatar_id":"","url":"https://api.github.com/users/wilzbach","html_url":"https://github.com/wilzbach","followers_url":"https://api.github.com/users/wilzbach/followers","following_url":"https://api.github.com/users/wilzbach/following{/other_user}","gists_url":"https://api.github.com/users/wilzbach/gists{/gist_id}","starred_url":"https://api.github.com/users/wilzbach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilzbach/subscriptions","organizations_url":"https://api.github.com/users/wilzbach/orgs","repos_url":"https://api.github.com/users/wilzbach/repos","events_url":"https://api.github.com/users/wilzbach/events{/privacy}","received_events_url":"https://api.github.com/users/wilzbach/received_events","type":"User","site_admin":false},"body":"I assume that there's probably a reason why the request parameters aren't lazily initialized, but I think the \"pay once you use\" is quite nice. Hence this PR is an open question whether the request parameters can be initialized on their first use. An additional benefit of using this pattern is that the returned `Json` reference is `const`.\r\nOf course, the same pattern could be used to \"lazify\" other request parameters as well.","created_at":"2017-02-08T23:42:28Z","updated_at":"2017-02-08T23:43:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d104d4d5c9110b712657587f5eb77fc4e4fea600","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/pulls/1677/commits","review_comments_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/pulls/1677/comments","review_comment_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/issues/1677/comments","statuses_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/statuses/b72b49dd6791647a36b67e7a5fcabddf798989ad","head":{"label":"wilzbach:lazy-json","ref":"lazy-json","sha":"b72b49dd6791647a36b67e7a5fcabddf798989ad","user":{"login":"wilzbach","id":4370550,"avatar_url":"https://avatars.githubusercontent.com/u/4370550?v=3","gravatar_id":"","url":"https://api.github.com/users/wilzbach","html_url":"https://github.com/wilzbach","followers_url":"https://api.github.com/users/wilzbach/followers","following_url":"https://api.github.com/users/wilzbach/following{/other_user}","gists_url":"https://api.github.com/users/wilzbach/gists{/gist_id}","starred_url":"https://api.github.com/users/wilzbach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilzbach/subscriptions","organizations_url":"https://api.github.com/users/wilzbach/orgs","repos_url":"https://api.github.com/users/wilzbach/repos","events_url":"https://api.github.com/users/wilzbach/events{/privacy}","received_events_url":"https://api.github.com/users/wilzbach/received_events","type":"User","site_admin":false},"repo":{"id":80843066,"name":"vibe.d","full_name":"wilzbach/vibe.d","owner":{"login":"wilzbach","id":4370550,"avatar_url":"https://avatars.githubusercontent.com/u/4370550?v=3","gravatar_id":"","url":"https://api.github.com/users/wilzbach","html_url":"https://github.com/wilzbach","followers_url":"https://api.github.com/users/wilzbach/followers","following_url":"https://api.github.com/users/wilzbach/following{/other_user}","gists_url":"https://api.github.com/users/wilzbach/gists{/gist_id}","starred_url":"https://api.github.com/users/wilzbach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilzbach/subscriptions","organizations_url":"https://api.github.com/users/wilzbach/orgs","repos_url":"https://api.github.com/users/wilzbach/repos","events_url":"https://api.github.com/users/wilzbach/events{/privacy}","received_events_url":"https://api.github.com/users/wilzbach/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wilzbach/vibe.d","description":"Official vibe.d development","fork":true,"url":"https://api.github.com/repos/wilzbach/vibe.d","forks_url":"https://api.github.com/repos/wilzbach/vibe.d/forks","keys_url":"https://api.github.com/repos/wilzbach/vibe.d/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wilzbach/vibe.d/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wilzbach/vibe.d/teams","hooks_url":"https://api.github.com/repos/wilzbach/vibe.d/hooks","issue_events_url":"https://api.github.com/repos/wilzbach/vibe.d/issues/events{/number}","events_url":"https://api.github.com/repos/wilzbach/vibe.d/events","assignees_url":"https://api.github.com/repos/wilzbach/vibe.d/assignees{/user}","branches_url":"https://api.github.com/repos/wilzbach/vibe.d/branches{/branch}","tags_url":"https://api.github.com/repos/wilzbach/vibe.d/tags","blobs_url":"https://api.github.com/repos/wilzbach/vibe.d/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wilzbach/vibe.d/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wilzbach/vibe.d/git/refs{/sha}","trees_url":"https://api.github.com/repos/wilzbach/vibe.d/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wilzbach/vibe.d/statuses/{sha}","languages_url":"https://api.github.com/repos/wilzbach/vibe.d/languages","stargazers_url":"https://api.github.com/repos/wilzbach/vibe.d/stargazers","contributors_url":"https://api.github.com/repos/wilzbach/vibe.d/contributors","subscribers_url":"https://api.github.com/repos/wilzbach/vibe.d/subscribers","subscription_url":"https://api.github.com/repos/wilzbach/vibe.d/subscription","commits_url":"https://api.github.com/repos/wilzbach/vibe.d/commits{/sha}","git_commits_url":"https://api.github.com/repos/wilzbach/vibe.d/git/commits{/sha}","comments_url":"https://api.github.com/repos/wilzbach/vibe.d/comments{/number}","issue_comment_url":"https://api.github.com/repos/wilzbach/vibe.d/issues/comments{/number}","contents_url":"https://api.github.com/repos/wilzbach/vibe.d/contents/{+path}","compare_url":"https://api.github.com/repos/wilzbach/vibe.d/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wilzbach/vibe.d/merges","archive_url":"https://api.github.com/repos/wilzbach/vibe.d/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wilzbach/vibe.d/downloads","issues_url":"https://api.github.com/repos/wilzbach/vibe.d/issues{/number}","pulls_url":"https://api.github.com/repos/wilzbach/vibe.d/pulls{/number}","milestones_url":"https://api.github.com/repos/wilzbach/vibe.d/milestones{/number}","notifications_url":"https://api.github.com/repos/wilzbach/vibe.d/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wilzbach/vibe.d/labels{/name}","releases_url":"https://api.github.com/repos/wilzbach/vibe.d/releases{/id}","deployments_url":"https://api.github.com/repos/wilzbach/vibe.d/deployments","created_at":"2017-02-03T15:44:22Z","updated_at":"2017-02-03T15:44:25Z","pushed_at":"2017-02-08T23:41:37Z","git_url":"git://github.com/wilzbach/vibe.d.git","ssh_url":"git@github.com:wilzbach/vibe.d.git","clone_url":"https://github.com/wilzbach/vibe.d.git","svn_url":"https://github.com/wilzbach/vibe.d","homepage":null,"size":17210,"stargazers_count":0,"watchers_count":0,"language":"D","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":"rejectedsoftware:master","ref":"master","sha":"27e9e167cbbd065ce42a833ac193575af7de3711","user":{"login":"rejectedsoftware","id":1661098,"avatar_url":"https://avatars.githubusercontent.com/u/1661098?v=3","gravatar_id":"","url":"https://api.github.com/users/rejectedsoftware","html_url":"https://github.com/rejectedsoftware","followers_url":"https://api.github.com/users/rejectedsoftware/followers","following_url":"https://api.github.com/users/rejectedsoftware/following{/other_user}","gists_url":"https://api.github.com/users/rejectedsoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/rejectedsoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rejectedsoftware/subscriptions","organizations_url":"https://api.github.com/users/rejectedsoftware/orgs","repos_url":"https://api.github.com/users/rejectedsoftware/repos","events_url":"https://api.github.com/users/rejectedsoftware/events{/privacy}","received_events_url":"https://api.github.com/users/rejectedsoftware/received_events","type":"Organization","site_admin":false},"repo":{"id":4081150,"name":"vibe.d","full_name":"rejectedsoftware/vibe.d","owner":{"login":"rejectedsoftware","id":1661098,"avatar_url":"https://avatars.githubusercontent.com/u/1661098?v=3","gravatar_id":"","url":"https://api.github.com/users/rejectedsoftware","html_url":"https://github.com/rejectedsoftware","followers_url":"https://api.github.com/users/rejectedsoftware/followers","following_url":"https://api.github.com/users/rejectedsoftware/following{/other_user}","gists_url":"https://api.github.com/users/rejectedsoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/rejectedsoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rejectedsoftware/subscriptions","organizations_url":"https://api.github.com/users/rejectedsoftware/orgs","repos_url":"https://api.github.com/users/rejectedsoftware/repos","events_url":"https://api.github.com/users/rejectedsoftware/events{/privacy}","received_events_url":"https://api.github.com/users/rejectedsoftware/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rejectedsoftware/vibe.d","description":"Official vibe.d development","fork":false,"url":"https://api.github.com/repos/rejectedsoftware/vibe.d","forks_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/forks","keys_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/teams","hooks_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/hooks","issue_events_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/issues/events{/number}","events_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/events","assignees_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/assignees{/user}","branches_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/branches{/branch}","tags_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/tags","blobs_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/git/refs{/sha}","trees_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/statuses/{sha}","languages_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/languages","stargazers_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/stargazers","contributors_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/contributors","subscribers_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/subscribers","subscription_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/subscription","commits_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/commits{/sha}","git_commits_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/git/commits{/sha}","comments_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/comments{/number}","issue_comment_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/issues/comments{/number}","contents_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/contents/{+path}","compare_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/merges","archive_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/downloads","issues_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/issues{/number}","pulls_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/pulls{/number}","milestones_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/milestones{/number}","notifications_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/labels{/name}","releases_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/releases{/id}","deployments_url":"https://api.github.com/repos/rejectedsoftware/vibe.d/deployments","created_at":"2012-04-19T23:10:11Z","updated_at":"2017-02-07T14:07:45Z","pushed_at":"2017-02-08T23:42:29Z","git_url":"git://github.com/rejectedsoftware/vibe.d.git","ssh_url":"git@github.com:rejectedsoftware/vibe.d.git","clone_url":"https://github.com/rejectedsoftware/vibe.d.git","svn_url":"https://github.com/rejectedsoftware/vibe.d","homepage":null,"size":17213,"stargazers_count":803,"watchers_count":803,"language":"D","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":231,"mirror_url":null,"open_issues_count":311,"forks":231,"open_issues":311,"watchers":803,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rejectedsoftware/vibe.d/pulls/1677"},"html":{"href":"https://github.com/rejectedsoftware/vibe.d/pull/1677"},"issue":{"href":"https://api.github.com/repos/rejectedsoftware/vibe.d/issues/1677"},"comments":{"href":"https://api.github.com/repos/rejectedsoftware/vibe.d/issues/1677/comments"},"review_comments":{"href":"https://api.github.com/repos/rejectedsoftware/vibe.d/pulls/1677/comments"},"review_comment":{"href":"https://api.github.com/repos/rejectedsoftware/vibe.d/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rejectedsoftware/vibe.d/pulls/1677/commits"},"statuses":{"href":"https://api.github.com/repos/rejectedsoftware/vibe.d/statuses/b72b49dd6791647a36b67e7a5fcabddf798989ad"}}}}
{"actor":{"display_login":"wilzbach"}}