kotlinx.serialization icon indicating copy to clipboard operation
kotlinx.serialization copied to clipboard

decodeSequentially does not pass SerialDescriptor

Open hfhbd opened this issue 10 months ago • 1 comments

What is your use-case and why do you need this feature?

decodeSequentially is the only function of CompositeDecoder that does not have the SerialDescriptor as parameter. I need to dynamically check if the data is sequentially and I need the SerialNames (getElementName) of the SerialDescriptor.

As a workaround I check if the data is sequentially in beginStructure.

Describe the solution you'd like Add SerialDescriptor as parameter to decodeSequentially. It is a breaking change but the api is marked as experimental so it should be fine.

hfhbd avatar Feb 03 '25 07:02 hfhbd

Indeed, adding it can be useful

sandwwraith avatar Feb 03 '25 10:02 sandwwraith