Him188 / yamlkt

Multiplatform YAML parser & serializer for kotlinx.serialization written in pure Kotlin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MissingFieldException, however field is present

Him188 opened this issue · comments

Simplified reproducer:

@Serializable
data class User(
    val mailAddress: String? = null,
    val name: String,
)
default.decodeFromString(User.serializer(), """
name: cssxsh
mailAddress: cssxsh@gmail.com
""")
    }

Root cause is wrong decodeNullableSerializableElement