Thread
#serialization
    e

    edenman

    2 years ago
    if anybody else is using
    KClass.serializer()
    it’s marked as
    @InternalSerializationApi
    in 1.0.0-RC, I filed https://github.com/Kotlin/kotlinx.serialization/issues/991 to try and get some more clarity on why it’s not recommended
    elizarov

    elizarov

    2 years ago
    It is not feature-full and fails to work correctly in some cases.
    e

    edenman

    2 years ago
    would love more detail on what cases it doesn’t work for
    elizarov

    elizarov

    2 years ago
    @sandwwraith can elaborate. However, it does not really matter what are its current limitations. They will definitely be changing from version to version. The key question here is why you need it?
    e

    edenman

    2 years ago
    sorry for delay, it’s late here. my usecase is laid out in the ticket (link to the github file
    OneOfSerializer
    ). i have a sealed class that represents a protobuf “oneof” where only one of the field names is set in the json, so i have a custom serializer for this case and use
    nestedClasses
    to get the implementations of the sealed class. then serializer checks for the fieldnames corresponding to the implementations
    Vsevolod Tolstopyatov [JB]

    Vsevolod Tolstopyatov [JB]

    2 years ago
    https://github.com/Kotlin/kotlinx.serialization/issues/991#issuecomment-676098265 I’ve answered in the issue, let’s move our discussion there