SharpYaml
SharpYaml copied to clipboard
Support for System Immutable collection types
The System.Collections.Immutable namespace contains immutable collection types.
Given the usefulness of immutable types for strong usage contracts and being able to depend on data passed by reference not mutating it would be great for SharpYaml to support serialization and deserialization of these collection types like it does for arrays.
Currently attempting to deserialize them throws an exception InvalidOperationException: Cannot deserialize list to readonly collection type [System.Collections.Immutable.ImmutableArray1[Subtype]].`
It'd be nice for C#9 Records to work as well, looks like this isn't supported here either just like the base fork issue: https://github.com/aaubry/YamlDotNet/issues/571