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.
An exception is thrown when using
VYaml
to serialize and then deserialize a record object containing anull
string. The following code reproduces this issue:The expected outcome of this code is that
obj.Name
andobj2.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.