-
-
Notifications
You must be signed in to change notification settings - Fork 492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Null value not properly serialized #611
Comments
This YAML snippet appears to be invalid.
|
The empty string is a valid, but not canonical, spelling of the value |
I didn't know empty strings were correct for null values, thanks for clarifying. Unfortunately, this means that deserializing an object serialized with YamlDotNet will yield a different object, since YamlDotNet itself interprets these null empty strings as non-null empty strings. So there is still a need to offer canonical serialization of nulls... |
This will be fixed when the next release goes out. |
Description
When serializing, null values (that is, null references, not strings with the value
"null"
) are written as an empty string instead of an actual YAML null. The possibility to serialize null values to actual null should be present either as a default or an option to theSerializerBuilder
class.As a side not, this issue is related to issues #591, #387 and #304 (ambiguous serialization of null-like values between YAML and CLR).
To reproduce
Expected output:
or
Actual output:
null_test:
The text was updated successfully, but these errors were encountered: