Thread
#serialization
    s

    serebit

    3 years ago
    Configuring polymorphic serialization by tag/ID is proving surprisingly difficult due to the lack of documentation. Are there any resources I should look at?
    Dominaezzz

    Dominaezzz

    3 years ago
    Did you find anything?
    s

    serebit

    3 years ago
    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.
    Dominaezzz

    Dominaezzz

    3 years ago
    Are you able to access this
    type
    key, post deserialisation?
    s

    serebit

    3 years ago
    I ended up removing the property because it was unnecessary after implementing polymorphic serialization, so I'm not sure