Michael Friend

    Michael Friend

    1 year ago
    When using polymorphic serialization is there any way to1. have the class discriminator available as a property on the base class 2. default to a particular subclass? My usecase has the
    type
    property on the json object somewhat overloaded where for one value i want to deserialize it into class A, but any other value is of type B and I need access to the
    type
    value. Adding
    type
    as a property gives an error
    because it has property name that conflicts with JSON class discriminator 'type'. You can either change class discriminator in JsonConfiguration, rename property with @SerialName annotation or fall back to array polymorphism
    I couldnt find any reference too array polymorphism anywhere
    Dominaezzz

    Dominaezzz

    1 year ago
    There's an issue open for the first one.
    The second one is possible using the serialise module.