Thread
#serialization
    s

    sandwwraith

    3 years ago
    Seems that idea of having different classDiscriminators per one response is really popular. We'll take a look on how we can implement this.
    s

    serebit

    3 years ago
    Not familiar with the backend, but maybe a
    SerialClassDiscriminator
    annotation on the discriminator property? Just a thought
    m

    Marc Knaup

    3 years ago
    There is no discriminator property 🤔 On the polymorphic base class would work
    Dominaezzz

    Dominaezzz

    3 years ago
    I like that idea, since it would also allow access to the property, post-deserialization.
    Or perhaps an argument to
    polymorphic<...>(classDiscriminator="type")
    .
    s

    serebit

    3 years ago
    In my particular situation, I have one flat class hierarchy that uses a key
    type
    for its class discriminator, then a complex hierarchy that uses
    op
    for the top level and
    t
    for a specific subclass hierarchy (I didn't design this). Hopefully your implementation can accommodate such complexity
    Dominaezzz

    Dominaezzz

    3 years ago
    @serebit Do you have a workaround?
    s

    serebit

    3 years ago
    Sadly no, although I haven't really looked for one @Dominaezzz
    Dominaezzz

    Dominaezzz

    3 years ago
    Aw, I'm having a hard time writing a custom serializer.