kotlinx.serialization
kotlinx.serialization copied to clipboard
`buildClassSerialDescriptor` does not create nullable descriptor
Originally reported as https://youtrack.jetbrains.com/issue/KT-52300
To Reproduce
val descriptor = buildClassSerialDescriptor("FooBar") {
isNullable = true
}
assertTrue(descriptor.isNullable) // throws
Expected behavior
Either we should allow to create nullable descriptors via builder or remove nullable property from it, leaving only descriptor.nullable extension. The latter would always append ? to serial name.
Environment
- Library version: 1.3.2