Open tyl3rdurden opened 1 month ago
It will be serialized using the declared type, not the actual type. Since it is declared as a Dog, it will be serialized as a Dog. If you want it to be a Dog or a Corgi, please declare it as an Animal.
It will be serialized using the declared type, not the actual type. Since it is declared as a Dog, it will be serialized as a Dog. If you want it to be a Dog or a Corgi, please declare it as an Animal.
Thanks for the reply. However, I intended it to be declared as a Dog as I want to prevent Cats from being put into the DogWalker.
Hello, I'm using the package really well after switching from JSON but I'm running into the following issue with multiple inheritance.
Data Layout
Failed Test
The above test fails as the deserializedData.Data always becomes a Dog and not the original Corgi. Is there anyway to preserve the inheritance without having Dog also be an abstract class or changing DogWalker's Data type to be an Animal? I would like to prevent Cats from being put into the DogWalker.
Much thanks!