You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Essentially, when serializing a null reference inside of a flow mapping its value gets translated to "". This in turn cannot be deserialized back to a given type, throwing an InvalidCastException.
So {Foo: ""} cannot be deserialized into a class class Bar { public Bar Foo }.
Instead {Foo: } (without the empty quotes) get deserialized just fine.
I don't know if that should be tackled inside the serialization or deserialization part, neither my YAML- nor my YamlDotNet-knowledge is sufficient.
To Reproduce
I've added a quick test to demonstrate the behaviour: krisrok@4a84500
The text was updated successfully, but these errors were encountered:
I just looked at this, it doesn't seem to be a problem any more. I used your test case, with the flow emitter it failed with what you showed. Without it, it worked fine. I used the following test case:
Describe the bug
Essentially, when serializing a null reference inside of a flow mapping its value gets translated to
""
. This in turn cannot be deserialized back to a given type, throwing anInvalidCastException
.So
{Foo: ""}
cannot be deserialized into a classclass Bar { public Bar Foo }
.Instead
{Foo: }
(without the empty quotes) get deserialized just fine.I don't know if that should be tackled inside the serialization or deserialization part, neither my YAML- nor my YamlDotNet-knowledge is sufficient.
To Reproduce
I've added a quick test to demonstrate the behaviour: krisrok@4a84500
The text was updated successfully, but these errors were encountered: