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
I have an untagged enum I'm trying to deserialize to. One of the variants looks for an optional field called m_Father. I expect the data in test.yml (below) to match this variant, but instead I get the error data did not match any variant of untagged enum Component. However if I re-write the enum variant as a struct, it deserializes correctly. I'm not sure if I'm overlooking a step or if something isn't working correctly.
This happens because conversion from YAML int to Rust String is done by the yaml deserializer. However, untagged enums deserialized from an intermediate deserializer, that buffers content and of course does not do such conversion, because it is specific for YAML. In other words, you suffer from #1183.
Bufferization is used because serde need to try each variant, but deserialization consumes the input. So need a way to provide the same input several times.
I have an untagged enum I'm trying to deserialize to. One of the variants looks for an optional field called
m_Father
. I expect the data intest.yml
(below) to match this variant, but instead I get the errordata did not match any variant of untagged enum Component
. However if I re-write the enum variant as a struct, it deserializes correctly. I'm not sure if I'm overlooking a step or if something isn't working correctly.Here is a minimal reproduction case:
Contents of
test.yml
:The text was updated successfully, but these errors were encountered: