yamlkt icon indicating copy to clipboard operation
yamlkt copied to clipboard

MissingFieldException, however field is present

Open Him188 opened this issue 5 years ago • 2 comments

https://github.com/mamoe/mirai-console/issues/191

Him188 avatar Oct 24 '20 13:10 Him188

Simplified reproducer:

@Serializable
data class User(
    val mailAddress: String? = null,
    val name: String,
)
default.decodeFromString(User.serializer(), """
name: cssxsh
mailAddress: [email protected]
""")
    }

Him188 avatar Oct 31 '20 05:10 Him188

Root cause is wrong decodeNullableSerializableElement

Him188 avatar Oct 31 '20 05:10 Him188