{"action":"created","issue":{"url":"https://api.github.com/repos/aws/aws-sdk-net/issues/161","labels_url":"https://api.github.com/repos/aws/aws-sdk-net/issues/161/labels{/name}","comments_url":"https://api.github.com/repos/aws/aws-sdk-net/issues/161/comments","events_url":"https://api.github.com/repos/aws/aws-sdk-net/issues/161/events","html_url":"https://github.com/aws/aws-sdk-net/issues/161","id":54886364,"number":161,"title":"Empty AttributeValues are indistinguishable","user":{"login":"WalkerCodeRanger","id":186398,"avatar_url":"https://avatars.githubusercontent.com/u/186398?v=3","gravatar_id":"","url":"https://api.github.com/users/WalkerCodeRanger","html_url":"https://github.com/WalkerCodeRanger","followers_url":"https://api.github.com/users/WalkerCodeRanger/followers","following_url":"https://api.github.com/users/WalkerCodeRanger/following{/other_user}","gists_url":"https://api.github.com/users/WalkerCodeRanger/gists{/gist_id}","starred_url":"https://api.github.com/users/WalkerCodeRanger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WalkerCodeRanger/subscriptions","organizations_url":"https://api.github.com/users/WalkerCodeRanger/orgs","repos_url":"https://api.github.com/users/WalkerCodeRanger/repos","events_url":"https://api.github.com/users/WalkerCodeRanger/events{/privacy}","received_events_url":"https://api.github.com/users/WalkerCodeRanger/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/aws/aws-sdk-net/labels/Bug","name":"Bug","color":"e11d21"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-01-20T14:05:46Z","updated_at":"2015-02-27T12:38:42Z","closed_at":"2015-02-27T12:38:42Z","body":"This may be related to issue #159.  I have found that three attribute values are indistinguishable through the public API.  The three values (all legal and the same as would be returned from a GetItem request) are:\r\n\r\n    var boolValue = new AttributeValue() { BOOL = false };\r\n    var listValue = new AttributeValue() { L = new List<AttributeValue>() };\r\n    var mapValue = new AttributeValue() { M = new Dictionary<string, AttributeValue>() };\r\n\r\nLooking at the code this appears to be mostly because collection values are initialized to an empty collection.  Using reflection to access the *internal* method `IsSetBOOL` the first value can be distinguished.  However, the last two are literally identical in their internal state.\r\n\r\nThis situation is UNACCEPTABLE.  It is literally impossible to determine the type of a stored value in a row if it is an empty list or map.  Something most be done to fix this.\r\n\r\nNote: this actually causes a bug in your own `Amazon.DynamoDBv2.DocumentModel` API where `null` will be returned instead of an empty `DynamoDBList` or empty `Document` because `IsSetL` and `IsSetM` return false."},"comment":{"url":"https://api.github.com/repos/aws/aws-sdk-net/issues/comments/76388451","html_url":"https://github.com/aws/aws-sdk-net/issues/161#issuecomment-76388451","issue_url":"https://api.github.com/repos/aws/aws-sdk-net/issues/161","id":76388451,"user":{"login":"WalkerCodeRanger","id":186398,"avatar_url":"https://avatars.githubusercontent.com/u/186398?v=3","gravatar_id":"","url":"https://api.github.com/users/WalkerCodeRanger","html_url":"https://github.com/WalkerCodeRanger","followers_url":"https://api.github.com/users/WalkerCodeRanger/followers","following_url":"https://api.github.com/users/WalkerCodeRanger/following{/other_user}","gists_url":"https://api.github.com/users/WalkerCodeRanger/gists{/gist_id}","starred_url":"https://api.github.com/users/WalkerCodeRanger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WalkerCodeRanger/subscriptions","organizations_url":"https://api.github.com/users/WalkerCodeRanger/orgs","repos_url":"https://api.github.com/users/WalkerCodeRanger/repos","events_url":"https://api.github.com/users/WalkerCodeRanger/events{/privacy}","received_events_url":"https://api.github.com/users/WalkerCodeRanger/received_events","type":"User","site_admin":false},"created_at":"2015-02-27T12:38:42Z","updated_at":"2015-02-27T12:38:42Z","body":"Thanks, I have updated my code to use these properties and they worked fine.  I would suggest you better document the use of these properties.  Particular setting `IsLSet` and `IsMSet` in order to put/update and empty list or map was not very clear."}}