{"action":"created","issue":{"url":"https://api.github.com/repos/boto/botocore/issues/495","labels_url":"https://api.github.com/repos/boto/botocore/issues/495/labels{/name}","comments_url":"https://api.github.com/repos/boto/botocore/issues/495/comments","events_url":"https://api.github.com/repos/boto/botocore/issues/495/events","html_url":"https://github.com/boto/botocore/pull/495","id":63116366,"number":495,"title":"Fix issue with rest-xml serialization","user":{"login":"kyleknap","id":4605355,"avatar_url":"https://avatars.githubusercontent.com/u/4605355?v=3","gravatar_id":"","url":"https://api.github.com/users/kyleknap","html_url":"https://github.com/kyleknap","followers_url":"https://api.github.com/users/kyleknap/followers","following_url":"https://api.github.com/users/kyleknap/following{/other_user}","gists_url":"https://api.github.com/users/kyleknap/gists{/gist_id}","starred_url":"https://api.github.com/users/kyleknap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kyleknap/subscriptions","organizations_url":"https://api.github.com/users/kyleknap/orgs","repos_url":"https://api.github.com/users/kyleknap/repos","events_url":"https://api.github.com/users/kyleknap/events{/privacy}","received_events_url":"https://api.github.com/users/kyleknap/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-19T23:36:11Z","updated_at":"2015-03-20T20:23:15Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/boto/botocore/pulls/495","html_url":"https://github.com/boto/botocore/pull/495","diff_url":"https://github.com/boto/botocore/pull/495.diff","patch_url":"https://github.com/boto/botocore/pull/495.patch"},"body":"If a parameter was a payload and that was something empty like an empty dictionary, it would get serialized to an empty body but really needs to get serialized to an empty xml structure. This caused issues when trying to turn off logging or notification for s3. Here is an example of what happens:\r\n```\r\n>>> import botocore.session\r\n>>> session = botocore.session.get_session()\r\n>>> s3 = session.create_client('s3')\r\n>>> s3.put_bucket_logging(Bucket='mybucket', BucketLoggingStatus={})\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\n  File \"botocore/client.py\", line 187, in _api_call\r\n    return self._make_api_call(operation_name, kwargs)\r\n  File \"botocore/client.py\", line 242, in _make_api_call\r\n    raise ClientError(parsed_response, operation_name)\r\nbotocore.exceptions.ClientError: An error occurred (MalformedXML) when calling the PutBucketLogging operation: The XML you provided was not well-formed or did not validate against our published schema\r\n``` \r\n\r\nFrom the CLI, here is a snippet of what we used to send over\r\n```\r\nDEBUG - Making request for <botocore.model.OperationModel object at 0x1044ac590> \r\n(verify_ssl=True) with params: {'query_string': {}, 'headers': {}, 'url_path': u'/mybucket?logging', 'body': '',\r\n 'method': u'PUT'}\r\n```\r\n\r\nNote it is correctly this now:\r\n```\r\nDEBUG - Making request for <botocore.model.OperationModel object at 0x10cda6f10> (verify_ssl=True)\r\n with params: {'query_string': {}, 'headers': {}, 'url_path': u'/mybucket?logging', 'body': \r\nu'<BucketLoggingStatus xmlns=\"http://s3.amazonaws.com/doc/2006-03-01/\" />', 'method': u'PUT'}\r\n```\r\n\r\nHere is reference to the s3 api docs as well: http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTlogging.html\r\n\r\ncc @jamesls @danielgtaylor "},"comment":{"url":"https://api.github.com/repos/boto/botocore/issues/comments/84134884","html_url":"https://github.com/boto/botocore/pull/495#issuecomment-84134884","issue_url":"https://api.github.com/repos/boto/botocore/issues/495","id":84134884,"user":{"login":"danielgtaylor","id":106826,"avatar_url":"https://avatars.githubusercontent.com/u/106826?v=3","gravatar_id":"","url":"https://api.github.com/users/danielgtaylor","html_url":"https://github.com/danielgtaylor","followers_url":"https://api.github.com/users/danielgtaylor/followers","following_url":"https://api.github.com/users/danielgtaylor/following{/other_user}","gists_url":"https://api.github.com/users/danielgtaylor/gists{/gist_id}","starred_url":"https://api.github.com/users/danielgtaylor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielgtaylor/subscriptions","organizations_url":"https://api.github.com/users/danielgtaylor/orgs","repos_url":"https://api.github.com/users/danielgtaylor/repos","events_url":"https://api.github.com/users/danielgtaylor/events{/privacy}","received_events_url":"https://api.github.com/users/danielgtaylor/received_events","type":"User","site_admin":false},"created_at":"2015-03-20T20:23:15Z","updated_at":"2015-03-20T20:23:15Z","body":"LGTM :ship:-it.\r\n\r\nHave you looked around at other calls to determine if it's easy to accidentally delete other values? E.g. setting `{}` as the body instead of `None` where before it did nothing but now deletes some configuration? I can't really think of any reason anybody would be doing this, but we should just double check."}}