serde-yaml
serde-yaml copied to clipboard
Serializing `Null` as `None`?
I have a field my_field: Option<Enum> and my yaml is like my_field: NULL.
Parsing it raise an error :
"unknown variant NULL, expected one of [...]
Looking at the code I see that Null is serialized at unit which makes me wonder :
- Why would anyone Serialize/Deserialize the unit type?
- Shouldn't
Nullin yaml beNonein Rust and vice versa?
(Working on a PR)
Actually serde_yaml only support the ~ and null for Null values, hence why NULL is not recognized.
It should be either:
- only
nullaccording to the yaml json schema null | Null | NULL | ~according to the yaml core schema