{"action":"created","issue":{"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/issues/2432","repository_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/issues/2432/labels{/name}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/issues/2432/comments","events_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/issues/2432/events","html_url":"https://github.com/GoogleCloudPlatform/google-cloud-dotnet/issues/2432","id":352070397,"node_id":"MDU6SXNzdWUzNTIwNzAzOTc=","number":2432,"title":"Deserializing empty object to attributed class","user":{"login":"DenSmoke","id":16131575,"node_id":"MDQ6VXNlcjE2MTMxNTc1","avatar_url":"https://avatars2.githubusercontent.com/u/16131575?v=4","gravatar_id":"","url":"https://api.github.com/users/DenSmoke","html_url":"https://github.com/DenSmoke","followers_url":"https://api.github.com/users/DenSmoke/followers","following_url":"https://api.github.com/users/DenSmoke/following{/other_user}","gists_url":"https://api.github.com/users/DenSmoke/gists{/gist_id}","starred_url":"https://api.github.com/users/DenSmoke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DenSmoke/subscriptions","organizations_url":"https://api.github.com/users/DenSmoke/orgs","repos_url":"https://api.github.com/users/DenSmoke/repos","events_url":"https://api.github.com/users/DenSmoke/events{/privacy}","received_events_url":"https://api.github.com/users/DenSmoke/received_events","type":"User","site_admin":false},"labels":[{"id":544302054,"node_id":"MDU6TGFiZWw1NDQzMDIwNTQ=","url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/labels/priority:%20p2","name":"priority: p2","color":"fef2c0","default":false},{"id":213377200,"node_id":"MDU6TGFiZWwyMTMzNzcyMDA=","url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/labels/type:%20question","name":"type: question","color":"c5def5","default":false}],"state":"open","locked":false,"assignee":{"login":"jskeet","id":17011,"node_id":"MDQ6VXNlcjE3MDEx","avatar_url":"https://avatars1.githubusercontent.com/u/17011?v=4","gravatar_id":"","url":"https://api.github.com/users/jskeet","html_url":"https://github.com/jskeet","followers_url":"https://api.github.com/users/jskeet/followers","following_url":"https://api.github.com/users/jskeet/following{/other_user}","gists_url":"https://api.github.com/users/jskeet/gists{/gist_id}","starred_url":"https://api.github.com/users/jskeet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jskeet/subscriptions","organizations_url":"https://api.github.com/users/jskeet/orgs","repos_url":"https://api.github.com/users/jskeet/repos","events_url":"https://api.github.com/users/jskeet/events{/privacy}","received_events_url":"https://api.github.com/users/jskeet/received_events","type":"User","site_admin":false},"assignees":[{"login":"jskeet","id":17011,"node_id":"MDQ6VXNlcjE3MDEx","avatar_url":"https://avatars1.githubusercontent.com/u/17011?v=4","gravatar_id":"","url":"https://api.github.com/users/jskeet","html_url":"https://github.com/jskeet","followers_url":"https://api.github.com/users/jskeet/followers","following_url":"https://api.github.com/users/jskeet/following{/other_user}","gists_url":"https://api.github.com/users/jskeet/gists{/gist_id}","starred_url":"https://api.github.com/users/jskeet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jskeet/subscriptions","organizations_url":"https://api.github.com/users/jskeet/orgs","repos_url":"https://api.github.com/users/jskeet/repos","events_url":"https://api.github.com/users/jskeet/events{/privacy}","received_events_url":"https://api.github.com/users/jskeet/received_events","type":"User","site_admin":false}],"milestone":null,"comments":6,"created_at":"2018-08-20T10:14:47Z","updated_at":"2018-08-20T15:56:45Z","closed_at":null,"author_association":"NONE","body":"Deserializing converts null object in array field of Firestore document to requested object type with same fields containing default values (null or zero).\r\nAfter \r\n```C#\r\nforeach (var change in snapshot.Changes)\r\n{\r\n    //...\r\n    var report = change.Document.ConvertTo<Report>();\r\n    //...\r\n}\r\n```\r\nthis\r\n![image](https://user-images.githubusercontent.com/16131575/44333303-1aa6c280-a477-11e8-8b5d-e28e626e981d.png)\r\nbecomes this\r\n![image](https://user-images.githubusercontent.com/16131575/44333371-41fd8f80-a477-11e8-90a2-ab7196711e02.png)\r\nParts of my classes:\r\n```C#\r\n[FirestoreData]\r\npublic class Report\r\n{\r\n    //...\r\n    [FirestoreProperty(\"usedDetails\")]\r\n    public List<Detail> UsedDetails { get; set; }\r\n    //...\r\n}\r\n[FirestoreData]\r\npublic class Detail\r\n{\r\n    [FirestoreProperty(\"name\")]\r\n    public string Name { get; set; }\r\n    [FirestoreProperty(\"quantity\")]\r\n    public int Count { get; set; }\r\n    [FirestoreProperty(\"price\")]\r\n    public double Price { get; set; }\r\n}\r\n```\r\nWhat's wrong?\r\nIt really doesn't affect my project, I discovered this by accident."},"comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/issues/comments/414368524","html_url":"https://github.com/GoogleCloudPlatform/google-cloud-dotnet/issues/2432#issuecomment-414368524","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/issues/2432","id":414368524,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNDM2ODUyNA==","user":{"login":"jskeet","id":17011,"node_id":"MDQ6VXNlcjE3MDEx","avatar_url":"https://avatars1.githubusercontent.com/u/17011?v=4","gravatar_id":"","url":"https://api.github.com/users/jskeet","html_url":"https://github.com/jskeet","followers_url":"https://api.github.com/users/jskeet/followers","following_url":"https://api.github.com/users/jskeet/following{/other_user}","gists_url":"https://api.github.com/users/jskeet/gists{/gist_id}","starred_url":"https://api.github.com/users/jskeet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jskeet/subscriptions","organizations_url":"https://api.github.com/users/jskeet/orgs","repos_url":"https://api.github.com/users/jskeet/repos","events_url":"https://api.github.com/users/jskeet/events{/privacy}","received_events_url":"https://api.github.com/users/jskeet/received_events","type":"User","site_admin":false},"created_at":"2018-08-20T15:56:45Z","updated_at":"2018-08-20T15:56:45Z","author_association":"MEMBER","body":"> Also I thought that after I got a DocumentSnapshot I don't perform any remote operations i.e. serialization and conversion occurs offline\r\n\r\nIt does. It's not clear what you think is happening here - or what you'd expect to happen.\r\n\r\nIt's just like deserializing `\"{}\"` with Json.NET - you end up with an object with no properties explicitly set, so they have their default values.\r\n\r\nPerhaps I've misunderstood what you're seeing - could you provide a short but complete example in code rather than the screenshots? (It's not clear to me what you're looking at or at what point.) Maybe there *is* a real problem here and I've just misunderstood what you're seeing..."}}
{"actor":{"display_login":"jskeet"}}