{"action":"created","issue":{"url":"https://api.github.com/repos/Azure/azure-iot-sdk-java/issues/221","repository_url":"https://api.github.com/repos/Azure/azure-iot-sdk-java","labels_url":"https://api.github.com/repos/Azure/azure-iot-sdk-java/issues/221/labels{/name}","comments_url":"https://api.github.com/repos/Azure/azure-iot-sdk-java/issues/221/comments","events_url":"https://api.github.com/repos/Azure/azure-iot-sdk-java/issues/221/events","html_url":"https://github.com/Azure/azure-iot-sdk-java/issues/221","id":311620653,"number":221,"title":"Set Desired Property with DeviceTwinDevice to null doesn't work","user":{"login":"karlchen7","id":27953601,"avatar_url":"https://avatars0.githubusercontent.com/u/27953601?v=4","gravatar_id":"","url":"https://api.github.com/users/karlchen7","html_url":"https://github.com/karlchen7","followers_url":"https://api.github.com/users/karlchen7/followers","following_url":"https://api.github.com/users/karlchen7/following{/other_user}","gists_url":"https://api.github.com/users/karlchen7/gists{/gist_id}","starred_url":"https://api.github.com/users/karlchen7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karlchen7/subscriptions","organizations_url":"https://api.github.com/users/karlchen7/orgs","repos_url":"https://api.github.com/users/karlchen7/repos","events_url":"https://api.github.com/users/karlchen7/events{/privacy}","received_events_url":"https://api.github.com/users/karlchen7/received_events","type":"User","site_admin":false},"labels":[{"id":461741541,"url":"https://api.github.com/repos/Azure/azure-iot-sdk-java/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-04-05T13:54:53Z","updated_at":"2018-04-09T17:34:30Z","closed_at":null,"author_association":"NONE","body":"Hello,\r\n\r\nI got an issue when I try to delete a property from the DeviceTwin\r\n\r\nSetup:\r\n\r\nWindows 8 \r\nJava 9.0.4\r\n ```\r\n  <dependency>\r\n            <groupId>com.microsoft.azure.sdk.iot</groupId>\r\n            <artifactId>iot-service-client</artifactId>\r\n            <version>1.13.0</version>\r\n        </dependency>\r\n        <dependency>\r\n            <groupId>com.google.code.gson</groupId>\r\n            <artifactId>gson</artifactId>\r\n            <version>2.8.2</version>\r\n        </dependency>\r\n```\r\n\r\nCode:\r\n\r\n```\r\n        DeviceTwin twinClient = DeviceTwin.createFromConnectionString(connString);\r\n        DeviceTwinDevice device = new DeviceTwinDevice(deviceId);\r\n\r\n        twinClient.getTwin(device);\r\n        System.out.println(\"Started with Device:\");\r\n        System.out.println(device);\r\n\r\n        JsonObject mainObj = new JsonObject();\r\n        mainObj.addProperty(\"test\",\"set\");\r\n        mainObj.addProperty(\"test2\",\"set2\");\r\n        System.out.println(mainObj);\r\n\r\n        HashSet<Pair> tags = new HashSet<Pair>();\r\n        tags.add(new Pair(\"eConfig\", mainObj));\r\n        device.setDesiredProperties(tags);\r\n        twinClient.updateTwin(device);\r\n        twinClient.getTwin(device);\r\n        System.out.println(device);\r\n\r\n        JsonObject mainObj2 = new JsonObject();\r\n        mainObj2.addProperty(\"test\",\"nope\");\r\n        mainObj2.add(\"test2\",null);\r\n        System.out.println(mainObj2);\r\n\r\n        HashSet<Pair> tags2 = new HashSet<Pair>();\r\n        tags2.add(new Pair(\"eConfig\", mainObj2));\r\n        device.setDesiredProperties(tags2);\r\n        twinClient.updateTwin(device);\r\n        twinClient.getTwin(device);\r\n        System.out.println(device);\r\n```\r\n\r\n\r\nConsole:\r\n\r\n```\r\nStarted with Device:\r\nDevice ID: TestDevice\r\nETag: AAAAAAAAABE=\r\nTags:{}\r\nReported Properties{}\r\nDesired Properties: {\"eConfig\":{\"test2\":\"set2\",\"test\":\"nope\"},\"$version\":17,\"$metadata\":{\"$lastUpdated\":\"2018-04-05T13:37:40.68Z\",\"$lastUpdatedVersion\":17,\"eConfig\":{\"$lastUpdated\":\"2018-04-05T13:37:40.68Z\",\"$lastUpdatedVersion\":17}}}\r\n\r\n{\"test\":\"set\",\"test2\":\"set2\"}\r\nDevice ID: TestDevice\r\nETag: AAAAAAAAABI=\r\nTags:{}\r\nReported Properties{}\r\nDesired Properties: {\"eConfig\":{\"test2\":\"set2\",\"test\":\"set\"},\"$version\":18,\"$metadata\":{\"$lastUpdated\":\"2018-04-05T13:38:15.177Z\",\"$lastUpdatedVersion\":18,\"eConfig\":{\"$lastUpdated\":\"2018-04-05T13:38:15.177Z\",\"$lastUpdatedVersion\":18}}}\r\n\r\n{\"test\":\"nope\",\"test2\":null}\r\nDevice ID: TestDevice\r\nETag: AAAAAAAAABM=\r\nTags:{}\r\nReported Properties{}\r\nDesired Properties: {\"eConfig\":{\"test2\":\"set2\",\"test\":\"nope\"},\"$version\":19,\"$metadata\":{\"$lastUpdated\":\"2018-04-05T13:38:15.240Z\",\"$lastUpdatedVersion\":19,\"eConfig\":{\"$lastUpdated\":\"2018-04-05T13:38:15.240Z\",\"$lastUpdatedVersion\":19}}}\r\n\r\nProcess finished with exit code 0\r\n```\r\n\r\nAt the last print there should be no test2 key and value anymore\r\nEven :\r\n        `tags.add(new Pair(\"eConfig\", null));`\r\n\r\ndoesn't do something\r\n\r\nGreetings"},"comment":{"url":"https://api.github.com/repos/Azure/azure-iot-sdk-java/issues/comments/379832279","html_url":"https://github.com/Azure/azure-iot-sdk-java/issues/221#issuecomment-379832279","issue_url":"https://api.github.com/repos/Azure/azure-iot-sdk-java/issues/221","id":379832279,"user":{"login":"timtay-microsoft","id":28789848,"avatar_url":"https://avatars0.githubusercontent.com/u/28789848?v=4","gravatar_id":"","url":"https://api.github.com/users/timtay-microsoft","html_url":"https://github.com/timtay-microsoft","followers_url":"https://api.github.com/users/timtay-microsoft/followers","following_url":"https://api.github.com/users/timtay-microsoft/following{/other_user}","gists_url":"https://api.github.com/users/timtay-microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/timtay-microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timtay-microsoft/subscriptions","organizations_url":"https://api.github.com/users/timtay-microsoft/orgs","repos_url":"https://api.github.com/users/timtay-microsoft/repos","events_url":"https://api.github.com/users/timtay-microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/timtay-microsoft/received_events","type":"User","site_admin":false},"created_at":"2018-04-09T17:34:30Z","updated_at":"2018-04-09T17:34:30Z","author_association":"CONTRIBUTOR","body":"I take it that this doesn't work in Service client 1.12.0 as well?"}}
{"actor":{"display_login":"timtay-microsoft"}}