Fails to Properly Deserialize `null` Strings
Freeesia opened this issue · 2 comments
Freeesia commented
An exception is thrown when using VYaml
to serialize and then deserialize a record object containing a null
string. The following code reproduces this issue:
var obj = new StringTest(null);
var yaml = YamlSerializer.Serialize(obj);
var obj2 = YamlSerializer.Deserialize<StringTest>(yaml);
if (obj.Name != obj2.Name)
{
throw new Exception("Failed");
}
[YamlObject]
partial record StringTest(string? Name);
The expected outcome of this code is that obj.Name
and obj2.Name
should be equal. However, they are not, hence the exception.
Could you please look into this issue and provide guidance or a potential fix? Thank you.
hadashiA commented
Freeesia commented
Thank you for the fix. I am looking forward to the release.