{"action":"created","comment":{"url":"https://api.github.com/repos/paulcbetts/refit/pulls/comments/32897887","id":32897887,"diff_hunk":"@@ -536,12 +583,33 @@ string getAttachmentNameForParameter(ParameterInfo paramInfo)\n                 throw new ArgumentException(\"Only one parameter can be a Body parameter\");\n             }\n \n-            if (bodyParams.Count == 0) {\n-                return null;\n+            // #1, body attribute wins\n+            if (bodyParams.Count == 1)\n+            {\n+                var ret = bodyParams[0];\n+                return Tuple.Create(ret.BodyAttribute.SerializationMethod, parameterList.IndexOf(ret.Parameter));\n+            }\n+\n+            // No body attribute found, check rule #2\n+         \n+            // see if we're a post/put/patch\n+            if (method.Equals(HttpMethod.Post) || method.Equals(HttpMethod.Put) || method.Equals(patchMethod))\n+            {\n+\n+                var refParams = parameterList.Where(pi => !pi.ParameterType.GetTypeInfo().IsValueType && pi.ParameterType != typeof(string)).ToList();\n+                \n+                // Check for rule #3\n+                if (refParams.Count > 1)\n+                {\n+                    throw new ArgumentException(\"Multiple complex types found. Specify one parameter as the body using BodyAttribute\");\n+                }\n+                else if (refParams.Count == 1)","path":"Refit/RequestBuilderImplementation.cs","position":230,"original_position":230,"commit_id":"363c78d51b239fcd3dafb5d003b6b1b9bf53009d","original_commit_id":"363c78d51b239fcd3dafb5d003b6b1b9bf53009d","user":{"login":"bennor","id":1063280,"avatar_url":"https://avatars.githubusercontent.com/u/1063280?v=3","gravatar_id":"","url":"https://api.github.com/users/bennor","html_url":"https://github.com/bennor","followers_url":"https://api.github.com/users/bennor/followers","following_url":"https://api.github.com/users/bennor/following{/other_user}","gists_url":"https://api.github.com/users/bennor/gists{/gist_id}","starred_url":"https://api.github.com/users/bennor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bennor/subscriptions","organizations_url":"https://api.github.com/users/bennor/orgs","repos_url":"https://api.github.com/users/bennor/repos","events_url":"https://api.github.com/users/bennor/events{/privacy}","received_events_url":"https://api.github.com/users/bennor/received_events","type":"User","site_admin":false},"body":":arrow_up:","created_at":"2015-06-21T21:28:15Z","updated_at":"2015-06-21T21:28:15Z","html_url":"https://github.com/paulcbetts/refit/pull/153#discussion_r32897887","pull_request_url":"https://api.github.com/repos/paulcbetts/refit/pulls/153","_links":{"self":{"href":"https://api.github.com/repos/paulcbetts/refit/pulls/comments/32897887"},"html":{"href":"https://github.com/paulcbetts/refit/pull/153#discussion_r32897887"},"pull_request":{"href":"https://api.github.com/repos/paulcbetts/refit/pulls/153"}}},"pull_request":{"url":"https://api.github.com/repos/paulcbetts/refit/pulls/153","id":38173220,"html_url":"https://github.com/paulcbetts/refit/pull/153","diff_url":"https://github.com/paulcbetts/refit/pull/153.diff","patch_url":"https://github.com/paulcbetts/refit/pull/153.patch","issue_url":"https://api.github.com/repos/paulcbetts/refit/issues/153","number":153,"state":"open","locked":false,"title":"Combined PR that addresses #88 and #89 in one","user":{"login":"onovotny","id":1427284,"avatar_url":"https://avatars.githubusercontent.com/u/1427284?v=3","gravatar_id":"","url":"https://api.github.com/users/onovotny","html_url":"https://github.com/onovotny","followers_url":"https://api.github.com/users/onovotny/followers","following_url":"https://api.github.com/users/onovotny/following{/other_user}","gists_url":"https://api.github.com/users/onovotny/gists{/gist_id}","starred_url":"https://api.github.com/users/onovotny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onovotny/subscriptions","organizations_url":"https://api.github.com/users/onovotny/orgs","repos_url":"https://api.github.com/users/onovotny/repos","events_url":"https://api.github.com/users/onovotny/events{/privacy}","received_events_url":"https://api.github.com/users/onovotny/received_events","type":"User","site_admin":false},"body":"I've merged the two into a single PR as I'm using it in an unofficial build for now....just passing it along.","created_at":"2015-06-20T19:46:54Z","updated_at":"2015-06-21T21:28:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2eb534bcb16f53e981dd6b0f9a2a9a2c1ea2db31","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/paulcbetts/refit/pulls/153/commits","review_comments_url":"https://api.github.com/repos/paulcbetts/refit/pulls/153/comments","review_comment_url":"https://api.github.com/repos/paulcbetts/refit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/paulcbetts/refit/issues/153/comments","statuses_url":"https://api.github.com/repos/paulcbetts/refit/statuses/363c78d51b239fcd3dafb5d003b6b1b9bf53009d","head":{"label":"onovotny:master-unofficial","ref":"master-unofficial","sha":"363c78d51b239fcd3dafb5d003b6b1b9bf53009d","user":{"login":"onovotny","id":1427284,"avatar_url":"https://avatars.githubusercontent.com/u/1427284?v=3","gravatar_id":"","url":"https://api.github.com/users/onovotny","html_url":"https://github.com/onovotny","followers_url":"https://api.github.com/users/onovotny/followers","following_url":"https://api.github.com/users/onovotny/following{/other_user}","gists_url":"https://api.github.com/users/onovotny/gists{/gist_id}","starred_url":"https://api.github.com/users/onovotny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onovotny/subscriptions","organizations_url":"https://api.github.com/users/onovotny/orgs","repos_url":"https://api.github.com/users/onovotny/repos","events_url":"https://api.github.com/users/onovotny/events{/privacy}","received_events_url":"https://api.github.com/users/onovotny/received_events","type":"User","site_admin":false},"repo":{"id":27872540,"name":"refit","full_name":"onovotny/refit","owner":{"login":"onovotny","id":1427284,"avatar_url":"https://avatars.githubusercontent.com/u/1427284?v=3","gravatar_id":"","url":"https://api.github.com/users/onovotny","html_url":"https://github.com/onovotny","followers_url":"https://api.github.com/users/onovotny/followers","following_url":"https://api.github.com/users/onovotny/following{/other_user}","gists_url":"https://api.github.com/users/onovotny/gists{/gist_id}","starred_url":"https://api.github.com/users/onovotny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onovotny/subscriptions","organizations_url":"https://api.github.com/users/onovotny/orgs","repos_url":"https://api.github.com/users/onovotny/repos","events_url":"https://api.github.com/users/onovotny/events{/privacy}","received_events_url":"https://api.github.com/users/onovotny/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/onovotny/refit","description":"The automatic type-safe REST library for Xamarin and .NET","fork":true,"url":"https://api.github.com/repos/onovotny/refit","forks_url":"https://api.github.com/repos/onovotny/refit/forks","keys_url":"https://api.github.com/repos/onovotny/refit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/onovotny/refit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/onovotny/refit/teams","hooks_url":"https://api.github.com/repos/onovotny/refit/hooks","issue_events_url":"https://api.github.com/repos/onovotny/refit/issues/events{/number}","events_url":"https://api.github.com/repos/onovotny/refit/events","assignees_url":"https://api.github.com/repos/onovotny/refit/assignees{/user}","branches_url":"https://api.github.com/repos/onovotny/refit/branches{/branch}","tags_url":"https://api.github.com/repos/onovotny/refit/tags","blobs_url":"https://api.github.com/repos/onovotny/refit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/onovotny/refit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/onovotny/refit/git/refs{/sha}","trees_url":"https://api.github.com/repos/onovotny/refit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/onovotny/refit/statuses/{sha}","languages_url":"https://api.github.com/repos/onovotny/refit/languages","stargazers_url":"https://api.github.com/repos/onovotny/refit/stargazers","contributors_url":"https://api.github.com/repos/onovotny/refit/contributors","subscribers_url":"https://api.github.com/repos/onovotny/refit/subscribers","subscription_url":"https://api.github.com/repos/onovotny/refit/subscription","commits_url":"https://api.github.com/repos/onovotny/refit/commits{/sha}","git_commits_url":"https://api.github.com/repos/onovotny/refit/git/commits{/sha}","comments_url":"https://api.github.com/repos/onovotny/refit/comments{/number}","issue_comment_url":"https://api.github.com/repos/onovotny/refit/issues/comments{/number}","contents_url":"https://api.github.com/repos/onovotny/refit/contents/{+path}","compare_url":"https://api.github.com/repos/onovotny/refit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/onovotny/refit/merges","archive_url":"https://api.github.com/repos/onovotny/refit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/onovotny/refit/downloads","issues_url":"https://api.github.com/repos/onovotny/refit/issues{/number}","pulls_url":"https://api.github.com/repos/onovotny/refit/pulls{/number}","milestones_url":"https://api.github.com/repos/onovotny/refit/milestones{/number}","notifications_url":"https://api.github.com/repos/onovotny/refit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/onovotny/refit/labels{/name}","releases_url":"https://api.github.com/repos/onovotny/refit/releases{/id}","created_at":"2014-12-11T13:23:08Z","updated_at":"2015-04-16T14:56:46Z","pushed_at":"2015-06-20T20:04:02Z","git_url":"git://github.com/onovotny/refit.git","ssh_url":"git@github.com:onovotny/refit.git","clone_url":"https://github.com/onovotny/refit.git","svn_url":"https://github.com/onovotny/refit","homepage":"http://paulcbetts.github.io/refit/","size":13112,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"paulcbetts:master","ref":"master","sha":"1ba4383a34b6a049fadd00f7645cef34f8b7592f","user":{"login":"paulcbetts","id":1396,"avatar_url":"https://avatars.githubusercontent.com/u/1396?v=3","gravatar_id":"","url":"https://api.github.com/users/paulcbetts","html_url":"https://github.com/paulcbetts","followers_url":"https://api.github.com/users/paulcbetts/followers","following_url":"https://api.github.com/users/paulcbetts/following{/other_user}","gists_url":"https://api.github.com/users/paulcbetts/gists{/gist_id}","starred_url":"https://api.github.com/users/paulcbetts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulcbetts/subscriptions","organizations_url":"https://api.github.com/users/paulcbetts/orgs","repos_url":"https://api.github.com/users/paulcbetts/repos","events_url":"https://api.github.com/users/paulcbetts/events{/privacy}","received_events_url":"https://api.github.com/users/paulcbetts/received_events","type":"User","site_admin":false},"repo":{"id":11591313,"name":"refit","full_name":"paulcbetts/refit","owner":{"login":"paulcbetts","id":1396,"avatar_url":"https://avatars.githubusercontent.com/u/1396?v=3","gravatar_id":"","url":"https://api.github.com/users/paulcbetts","html_url":"https://github.com/paulcbetts","followers_url":"https://api.github.com/users/paulcbetts/followers","following_url":"https://api.github.com/users/paulcbetts/following{/other_user}","gists_url":"https://api.github.com/users/paulcbetts/gists{/gist_id}","starred_url":"https://api.github.com/users/paulcbetts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulcbetts/subscriptions","organizations_url":"https://api.github.com/users/paulcbetts/orgs","repos_url":"https://api.github.com/users/paulcbetts/repos","events_url":"https://api.github.com/users/paulcbetts/events{/privacy}","received_events_url":"https://api.github.com/users/paulcbetts/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/paulcbetts/refit","description":"The automatic type-safe REST library for Xamarin and .NET","fork":false,"url":"https://api.github.com/repos/paulcbetts/refit","forks_url":"https://api.github.com/repos/paulcbetts/refit/forks","keys_url":"https://api.github.com/repos/paulcbetts/refit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/paulcbetts/refit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/paulcbetts/refit/teams","hooks_url":"https://api.github.com/repos/paulcbetts/refit/hooks","issue_events_url":"https://api.github.com/repos/paulcbetts/refit/issues/events{/number}","events_url":"https://api.github.com/repos/paulcbetts/refit/events","assignees_url":"https://api.github.com/repos/paulcbetts/refit/assignees{/user}","branches_url":"https://api.github.com/repos/paulcbetts/refit/branches{/branch}","tags_url":"https://api.github.com/repos/paulcbetts/refit/tags","blobs_url":"https://api.github.com/repos/paulcbetts/refit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/paulcbetts/refit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/paulcbetts/refit/git/refs{/sha}","trees_url":"https://api.github.com/repos/paulcbetts/refit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/paulcbetts/refit/statuses/{sha}","languages_url":"https://api.github.com/repos/paulcbetts/refit/languages","stargazers_url":"https://api.github.com/repos/paulcbetts/refit/stargazers","contributors_url":"https://api.github.com/repos/paulcbetts/refit/contributors","subscribers_url":"https://api.github.com/repos/paulcbetts/refit/subscribers","subscription_url":"https://api.github.com/repos/paulcbetts/refit/subscription","commits_url":"https://api.github.com/repos/paulcbetts/refit/commits{/sha}","git_commits_url":"https://api.github.com/repos/paulcbetts/refit/git/commits{/sha}","comments_url":"https://api.github.com/repos/paulcbetts/refit/comments{/number}","issue_comment_url":"https://api.github.com/repos/paulcbetts/refit/issues/comments{/number}","contents_url":"https://api.github.com/repos/paulcbetts/refit/contents/{+path}","compare_url":"https://api.github.com/repos/paulcbetts/refit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/paulcbetts/refit/merges","archive_url":"https://api.github.com/repos/paulcbetts/refit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/paulcbetts/refit/downloads","issues_url":"https://api.github.com/repos/paulcbetts/refit/issues{/number}","pulls_url":"https://api.github.com/repos/paulcbetts/refit/pulls{/number}","milestones_url":"https://api.github.com/repos/paulcbetts/refit/milestones{/number}","notifications_url":"https://api.github.com/repos/paulcbetts/refit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/paulcbetts/refit/labels{/name}","releases_url":"https://api.github.com/repos/paulcbetts/refit/releases{/id}","created_at":"2013-07-22T20:11:57Z","updated_at":"2015-06-20T17:35:42Z","pushed_at":"2015-06-20T20:04:36Z","git_url":"git://github.com/paulcbetts/refit.git","ssh_url":"git@github.com:paulcbetts/refit.git","clone_url":"https://github.com/paulcbetts/refit.git","svn_url":"https://github.com/paulcbetts/refit","homepage":"http://paulcbetts.github.io/refit/","size":22405,"stargazers_count":581,"watchers_count":581,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":67,"mirror_url":null,"open_issues_count":36,"forks":67,"open_issues":36,"watchers":581,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/paulcbetts/refit/pulls/153"},"html":{"href":"https://github.com/paulcbetts/refit/pull/153"},"issue":{"href":"https://api.github.com/repos/paulcbetts/refit/issues/153"},"comments":{"href":"https://api.github.com/repos/paulcbetts/refit/issues/153/comments"},"review_comments":{"href":"https://api.github.com/repos/paulcbetts/refit/pulls/153/comments"},"review_comment":{"href":"https://api.github.com/repos/paulcbetts/refit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/paulcbetts/refit/pulls/153/commits"},"statuses":{"href":"https://api.github.com/repos/paulcbetts/refit/statuses/363c78d51b239fcd3dafb5d003b6b1b9bf53009d"}}}}