Open vlad-ivanov-name opened 1 year ago
Thanks for the detailed reproducer!
Since deserializing A
by itself works, but Test
doesn't it seems to be related to the enum handling within the hcl
deserializer when custom deserialize logic is injected as in your case.
There are some hardcoded assumptions in there right now to ensure correct roundtripping of the hcl-rs types themselves. The error message surfaces that. This needs to be adjusted to handle more "foreign" type layouts passed in.
I'd be happy to get this fixed, but unfortunately I'm currently busy with some personal obligations over then next 2 or 3 months, so I'm not sure I can get my hands (and head) on it anytime soon.
But if you feel like digging deeper into it I'm happy to receive a PR in the meantime 😉
I ran into a seemingly complex edge case where deserialisation fails when an untagged enum is used together with
deserialize_with
. In the following example:de_transform
function will fail with:I haven't been able to find a workaround unfortunately