Thread
#serialization
    melatonina

    melatonina

    1 year ago
    Hello. The polymorphic serialization of a sealed class is generating this kind of json:
    ["folder",{"clipFolderId":{"value":"ae5cab51-4336-494f-86c8-e233cebc5467"}}]
    instead of something like:
    {type:"folder", "clipFolderId":{"value":"ae5cab51-4336-494f-86c8-e233cebc5467"}}
    as is described in the documentation. I'm using
    org.jetbrains.kotlin:kotlin-serialization:1.4.31
    and
    org.jetbrains.kotlinx:kotlinx-serialization-json:1.1.0
    . What could be the cause?
    Dominaezzz

    Dominaezzz

    1 year ago
    Can you share the sealed class?
    I'm more interested in the annotations, so you don't have to share the whole thing.
    Also, the
    Json
    instance you pass to KTor, what are the params you pass to it?