You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current implementation relies on kotlinx.serialization.descriptors.SerialDescriptor#getElementsCount. According to documentation it will be always 1.
/** * The number of elements this descriptor describes, besides from the class itself. * [elementsCount] describes the number of **semantic** elements, not the number * of actual fields/properties in the serialized form, even though they frequently match. * * For example, for the following class * `class Complex(val real: Long, val imaginary: Long)` the corresponding descriptor * and the serialized form both have two elements, while for `class IntList : ArrayList<Int>()` * the corresponding descriptor has a single element (`IntDescriptor`, the type of list element), * but from zero up to `Int.MAX_VALUE` values in the serialized form.*/
@ExperimentalSerializationApi
publicval elementsCount:Int
As a result when Decoder tries to decode list field it gives up after first value. From screenshot below you can see that from underlying storage 16 elements was read but with current implementation it will contain only one element after decoding document to Kotlin data class.
The text was updated successfully, but these errors were encountered:
Current implementation relies on
kotlinx.serialization.descriptors.SerialDescriptor#getElementsCount
. According to documentation it will be always 1.As a result when Decoder tries to decode list field it gives up after first value. From screenshot below you can see that from underlying storage 16 elements was read but with current implementation it will contain only one element after decoding document to Kotlin data class.
The text was updated successfully, but these errors were encountered: