Exception when Deserializing Empty List When Emit(Behavior) is Set
See original GitHub issueExample class:
public class Foo
{
public List<string> Baz { get; } = new List<string>();
}
Baz does not have a setter. When trying do deserialize a serialized XML an exception occurs.
Also, somewhat related, but would it be possible to add an option for the serializer to ignore all properties without a setter?
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (9 by maintainers)
Top Results From Across the Web
Exception when Deserializing Empty List When Emit(Behavior) is ...
When trying do deserialize a serialized XML an exception occurs. ... Exception when Deserializing Empty List When Emit(Behavior) is Set #216.
Read more >JSON deserialization fails only when array is empty
On some occasions when I receive JSON whose one of the array property is empty the deserialization fails, throwing the following exception :....
Read more >Migrate from Newtonsoft.Json to System.Text.Json - .NET
Deserialize null to non-nullable type. Newtonsoft.Json doesn't throw an exception in the following scenario: NullValueHandling is set to Ignore ...
Read more >Empty list on serializable coming up as null instead of empty?
This is throwing me because I thought that lists could never be null. They just create empty. What is going on here and...
Read more >Writing JSON REST Services
The JSON serialization library tries to get the list of fields of Legume and gets an empty list, so it does not serialize...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is strange. I’ll take care of it.
Bummer @wojtpl2 it still looks broken: https://www.nuget.org/packages/ExtendedXmlSerializer/
Still on
2.1.6
. 😦