2 ms·
> So for deserialization, you'd need an extra wrapper type that provides the json.Unmarshaler implementation. You'll probably need something along those lines
by masklinn 5y ago
> So for deserialization, you'd need an extra wrapper type that provides the json.Unmarshaler implementation.
You'll probably need something along those lines either way, for the simple reason that there is no single mapping between sum types and JSON (or equivalent / similar)
For instance serde provides 3 different serialisation schemes, and once in a while you still need a bespoke deserialiser.