Configuring polymorphic serialization by tag/ID is...
# serialization
s
Configuring polymorphic serialization by tag/ID is proving surprisingly difficult due to the lack of documentation. Are there any resources I should look at?
d
Did you find anything?
s
I did, yes. It was specific to my situation, but I can describe the problem I had. The API I'm interacting with sends type info with a
type
key, and an integer value. I was trying to use
SerialId
to set the discriminator, but I kept getting the error message that there were no serializers configured for the type integers I was getting. I eventually figured out that I needed to use
SerialName
instead, and after that everything worked as expected.
d
Are you able to access this
type
key, post deserialisation?
s
I ended up removing the property because it was unnecessary after implementing polymorphic serialization, so I'm not sure