2 years ago
    can kotlinx.serialization be convinced to allow for some non-exact class matches when polymorphic? I'd like to use it on various data structures containing
    . regardless of the exact type, I want to handle them all the same way - serialize their
    , and a subset of their spans if
    (Android interface), ignoring everything else. but it seems like polymorphic(CharSequence::class) is forcing me to write a separate serializer for every possible concrete class
    to answer my own question, I've ended up writing my own serializer and registering it with
    on top of all the classes containing CharSequence. annoyingly, it doesn't seem possible to affect serialization of fields within classes not under my direct control.