{"action":"created","issue":{"url":"https://api.github.com/repos/aws/aws-sdk-ruby/issues/831","labels_url":"https://api.github.com/repos/aws/aws-sdk-ruby/issues/831/labels{/name}","comments_url":"https://api.github.com/repos/aws/aws-sdk-ruby/issues/831/comments","events_url":"https://api.github.com/repos/aws/aws-sdk-ruby/issues/831/events","html_url":"https://github.com/aws/aws-sdk-ruby/issues/831","id":82407029,"number":831,"title":"DynamoDB: Unable to put binary data","user":{"login":"der-flo","id":35431,"avatar_url":"https://avatars.githubusercontent.com/u/35431?v=3","gravatar_id":"","url":"https://api.github.com/users/der-flo","html_url":"https://github.com/der-flo","followers_url":"https://api.github.com/users/der-flo/followers","following_url":"https://api.github.com/users/der-flo/following{/other_user}","gists_url":"https://api.github.com/users/der-flo/gists{/gist_id}","starred_url":"https://api.github.com/users/der-flo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/der-flo/subscriptions","organizations_url":"https://api.github.com/users/der-flo/orgs","repos_url":"https://api.github.com/users/der-flo/repos","events_url":"https://api.github.com/users/der-flo/events{/privacy}","received_events_url":"https://api.github.com/users/der-flo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/aws/aws-sdk-ruby/labels/bug","name":"bug","color":"e10c02"},{"url":"https://api.github.com/repos/aws/aws-sdk-ruby/labels/Version%202","name":"Version 2","color":"207de5"}],"state":"open","locked":false,"assignee":{"login":"awood45","id":2114465,"avatar_url":"https://avatars.githubusercontent.com/u/2114465?v=3","gravatar_id":"","url":"https://api.github.com/users/awood45","html_url":"https://github.com/awood45","followers_url":"https://api.github.com/users/awood45/followers","following_url":"https://api.github.com/users/awood45/following{/other_user}","gists_url":"https://api.github.com/users/awood45/gists{/gist_id}","starred_url":"https://api.github.com/users/awood45/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awood45/subscriptions","organizations_url":"https://api.github.com/users/awood45/orgs","repos_url":"https://api.github.com/users/awood45/repos","events_url":"https://api.github.com/users/awood45/events{/privacy}","received_events_url":"https://api.github.com/users/awood45/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-05-29T12:27:00Z","updated_at":"2015-06-02T23:17:04Z","closed_at":null,"body":"When trying to put binary data to DynamoDB, I get an exception regarding the usage of an IO (eg. `StringIO`) type. I'm using the actual gem (2.0.47).\r\n\r\nSimple example to reproduce:\r\n``` ruby\r\nrequire 'aws-sdk'\r\nclient = Aws::DynamoDB::Client.new(region: 'eu-west-1')\r\n\r\nitem = {\r\n  'id' => 'bar',\r\n  'foo' => StringIO.new('baz')\r\n}\r\nclient.put_item(table_name: 'foobar', item: item)\r\n```\r\n\r\nException and backtrace:\r\n```\r\n[...]/aws-sdk-core-2.0.47/lib/aws-sdk-core/json/builder.rb:54:in `format': undefined method `read' for \"baz\":String (NoMethodError)\r\nfrom [...]/aws-sdk-core-2.0.47/lib/aws-sdk-core/json/builder.rb:24:in `block in structure'\r\nfrom [...]/aws-sdk-core-2.0.47/lib/aws-sdk-core/json/builder.rb:20:in `each'\r\nfrom [...]/aws-sdk-core-2.0.47/lib/aws-sdk-core/json/builder.rb:20:in `with_object'\r\nfrom [...]/aws-sdk-core-2.0.47/lib/aws-sdk-core/json/builder.rb:20:in `structure'\r\nfrom [...]/aws-sdk-core-2.0.47/lib/aws-sdk-core/json/builder.rb:50:in `format'\r\nfrom [...]/aws-sdk-core-2.0.47/lib/aws-sdk-core/json/builder.rb:41:in `block in map'\r\nfrom [...]/aws-sdk-core-2.0.47/lib/aws-sdk-core/json/builder.rb:40:in `each'\r\nfrom [...]/aws-sdk-core-2.0.47/lib/aws-sdk-core/json/builder.rb:40:in `with_object'\r\nfrom [...]/aws-sdk-core-2.0.47/lib/aws-sdk-core/json/builder.rb:40:in `map'\r\nfrom [...]/aws-sdk-core-2.0.47/lib/aws-sdk-core/json/builder.rb:52:in `format'\r\nfrom [...]/aws-sdk-core-2.0.47/lib/aws-sdk-core/json/builder.rb:24:in `block in structure'\r\nfrom [...]/aws-sdk-core-2.0.47/lib/aws-sdk-core/json/builder.rb:20:in `each'\r\nfrom [...]/aws-sdk-core-2.0.47/lib/aws-sdk-core/json/builder.rb:20:in `with_object'\r\nfrom [...]/aws-sdk-core-2.0.47/lib/aws-sdk-core/json/builder.rb:20:in `structure'\r\nfrom [...]/aws-sdk-core-2.0.47/lib/aws-sdk-core/json/builder.rb:50:in `format'\r\nfrom [...]/aws-sdk-core-2.0.47/lib/aws-sdk-core/json/builder.rb:11:in `to_json'\r\nfrom [...]/aws-sdk-core-2.0.47/lib/aws-sdk-core/json/rpc_body_handler.rb:20:in `build_json'\r\nfrom [...]/aws-sdk-core-2.0.47/lib/aws-sdk-core/json/rpc_body_handler.rb:8:in `call'\r\nfrom [...]/aws-sdk-core-2.0.47/lib/aws-sdk-core/json/rpc_headers_handler.rb:10:in `call'\r\nfrom [...]/aws-sdk-core-2.0.47/lib/aws-sdk-core/plugins/user_agent.rb:12:in `call'\r\nfrom [...]/aws-sdk-core-2.0.47/lib/seahorse/client/plugins/restful_bindings.rb:13:in `call'\r\nfrom [...]/aws-sdk-core-2.0.47/lib/seahorse/client/plugins/endpoint.rb:31:in `call'\r\nfrom [...]/aws-sdk-core-2.0.47/lib/seahorse/client/plugins/param_validation.rb:22:in `call'\r\nfrom [...]/aws-sdk-core-2.0.47/lib/seahorse/client/plugins/raise_response_errors.rb:14:in `call'\r\nfrom [...]/aws-sdk-core-2.0.47/lib/aws-sdk-core/plugins/dynamodb_simple_attributes.rb:112:in `call'\r\nfrom [...]/aws-sdk-core-2.0.47/lib/seahorse/client/plugins/param_conversion.rb:22:in `call'\r\nfrom [...]/aws-sdk-core-2.0.47/lib/aws-sdk-core/plugins/response_paging.rb:10:in `call'\r\nfrom [...]/aws-sdk-core-2.0.47/lib/seahorse/client/plugins/response_target.rb:18:in `call'\r\nfrom [...]/aws-sdk-core-2.0.47/lib/seahorse/client/request.rb:70:in `send_request'\r\nfrom [...]/aws-sdk-core-2.0.47/lib/seahorse/client/base.rb:216:in `block (2 levels) in define_operation_methods'"},"comment":{"url":"https://api.github.com/repos/aws/aws-sdk-ruby/issues/comments/108126696","html_url":"https://github.com/aws/aws-sdk-ruby/issues/831#issuecomment-108126696","issue_url":"https://api.github.com/repos/aws/aws-sdk-ruby/issues/831","id":108126696,"user":{"login":"awood45","id":2114465,"avatar_url":"https://avatars.githubusercontent.com/u/2114465?v=3","gravatar_id":"","url":"https://api.github.com/users/awood45","html_url":"https://github.com/awood45","followers_url":"https://api.github.com/users/awood45/followers","following_url":"https://api.github.com/users/awood45/following{/other_user}","gists_url":"https://api.github.com/users/awood45/gists{/gist_id}","starred_url":"https://api.github.com/users/awood45/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awood45/subscriptions","organizations_url":"https://api.github.com/users/awood45/orgs","repos_url":"https://api.github.com/users/awood45/repos","events_url":"https://api.github.com/users/awood45/events{/privacy}","received_events_url":"https://api.github.com/users/awood45/received_events","type":"User","site_admin":false},"created_at":"2015-06-02T23:17:04Z","updated_at":"2015-06-02T23:17:04Z","body":"I have a possible fix written which passes in your case, but there are a few other cases I want to check in review. Will push up my changes to a branch and PR."}}