melatonina

    melatonina

    2 years ago
    Hello. Where can I find the documentation for the version 0.14.0 of the API for writing custom serializers? I'm interested in using
    encoder.beginCollection()
    , in particular. The signature is
    fun beginCollection(desc: SerialDescriptor, collectionSize: Int, vararg typeParams: KSerializer<*>)
    . What is
    desc
    the descriptor of? What are the
    typeParams
    ? I can't upgrade to 0.20.0 because I can't use the compiler beyond 1.3.61 at the moment (Arrow meta won't work).
    I'll try Moshi. It seems to also support inline classes.
    e

    ephemient

    2 years ago
    all of the encode and decode methods take the current object's descriptor as their first argument, so they don't need to carry that state around themselves
    melatonina

    melatonina

    2 years ago
    Thanks, @ephemient!