-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
When decoding a SerialKind.OBJECT the BsonFlexibleDecoder does not start the document read, but it does end it.
This causes the following error when attempting to decode objects even if they are {} in the database:
org.bson.BsonInvalidOperationException: readEndDocument can only be called when ContextType is DOCUMENT or SCOPE_DOCUMENT, not when ContextType is TOP_LEVEL.
at org.bson.AbstractBsonReader.throwInvalidContextType(AbstractBsonReader.java:654)
at org.bson.AbstractBsonReader.readEndDocument(AbstractBsonReader.java:347)
at com.github.jershell.kbson.FlexibleDecoder.endStructure(BsonFlexibleDecoder.kt:61)
at kotlinx.serialization.internal.ObjectSerializer.deserialize(ObjectSerializer.kt:57)
at kotlinx.serialization.encoding.Decoder$DefaultImpls.decodeSerializableValue(Decoding.kt:257)
at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:16)
at com.application.codec.CustomCodec.decode(CustomCodec.kt:71)
...
Metadata
Metadata
Assignees
Labels
No labels