doesn’t work on interfaces. The only way I can get polymorphic serialisation/deserialisation to work with interfaces is to register a polymorphic serialiser for it manually (as the docs specify). This ignores
JsonClassDiscriminator
though, it only seems to work when the discriminator is the default key:
type
e
ephemient
10/28/2021, 8:33 AM
@JsonClassDiscriminator
+
PolymorphicSerializer
works for me; when I build and run this snippet, it produces
Copy code
{
"__type": "example.Bar"
}
EDIT: I thought this was running as expected when I wrote it, but it doesn't work for me anymore. I must have mixed it up with the