Describe the bug
I am trying to deserialize this map as Map<String, Any>
val env = mapOf(
"provider" to listOf("https://ipfs.wrappers.io"),
"fallbackProviders" to listOf("https://ipfs.io"),
"retries" to mapOf("tryResolveUri" to 2, "getFile" to 2),
)
val encodedEnv = msgPackEncode(MsgPackDynamicSerializer, env)
I am getting the "End of Stream" exception thrown at line 31 of MsgPackDataBuffer.
kotlin.Exception: End of stream
at kotlin.Throwable#<init>(/opt/buildAgent/work/460cf706e11bbdb0/kotlin/kotlin-native/runtime/src/main/kotlin/kotlin/Throwable.kt:25)
at kotlin.Exception#<init>(/opt/buildAgent/work/460cf706e11bbdb0/kotlin/kotlin-native/runtime/src/main/kotlin/kotlin/Exceptions.kt:23)
at com.ensarsarajcic.kotlinx.serialization.msgpack.stream.MsgPackDataInputBuffer#requireNextByte(/Users/kris/IdeaProjects/esensar/kotlinx-serialization-msgpack/serialization-msgpack/src/commonMain/kotlin/com.ensarsarajcic.kotlinx.serialization.msgpack/stream/MsgPackDataBuffer.kt:31)
at com.ensarsarajcic.kotlinx.serialization.msgpack.internal.BasicMsgPackDecoder#decodeCollectionSize(/Users/kris/IdeaProjects/esensar/kotlinx-serialization-msgpack/serialization-msgpack/src/commonMain/kotlin/com.ensarsarajcic.kotlinx.serialization.msgpack/internal/MsgPackDecoder.kt:128)
at com.ensarsarajcic.kotlinx.serialization.msgpack.internal.BasicMsgPackDecoder#beginStructure(/Users/kris/IdeaProjects/esensar/kotlinx-serialization-msgpack/serialization-msgpack/src/commonMain/kotlin/com.ensarsarajcic.kotlinx.serialization.msgpack/internal/MsgPackDecoder.kt:192)
at eth.krisbitney.polywrap.uriResolvers.extendable.MaybeUriOrManifest.$serializer#deserialize(/Users/kris/IdeaProjects/krisbitney/polywrap-kt/src/commonMain/kotlin/eth.krisbitney.polywrap/uriResolvers/extendable/MaybeUriOrManifest.kt:1)
at kotlinx.serialization.encoding.Decoder#decodeSerializableValue(/opt/buildAgent/work/b2fef8360e1bcf3d/core/commonMain/src/kotlinx/serialization/encoding/Decoding.kt:257)
at com.ensarsarajcic.kotlinx.serialization.msgpack.internal.BasicMsgPackDecoder#decodeSerializableValue(/Users/kris/IdeaProjects/esensar/kotlinx-serialization-msgpack/serialization-msgpack/src/commonMain/kotlin/com.ensarsarajcic.kotlinx.serialization.msgpack/internal/MsgPackDecoder.kt:182)
at com.ensarsarajcic.kotlinx.serialization.msgpack.internal.MsgPackDecoder#decodeSerializableValue(/Users/kris/IdeaProjects/esensar/kotlinx-serialization-msgpack/serialization-msgpack/src/commonMain/kotlin/com.ensarsarajcic.kotlinx.serialization.msgpack/internal/MsgPackDecoder.kt:1)
at com.ensarsarajcic.kotlinx.serialization.msgpack.MsgPack#decodeFromByteArray(/Users/kris/IdeaProjects/esensar/kotlinx-serialization-msgpack/serialization-msgpack/src/commonMain/kotlin/com.ensarsarajcic.kotlinx.serialization.msgpack/MsgPack.kt:50)
at eth.krisbitney.polywrap.msgpack#msgPackDecode(/Users/kris/IdeaProjects/krisbitney/polywrap-kt/src/commonMain/kotlin/eth.krisbitney.polywrap/msgpack/serialization.kt:66)
at eth.krisbitney.polywrap.uriResolvers.extendable.UriResolverWrapper.$tryResolveUriWithImplementationCOROUTINE$129.invokeSuspend#internal(/Users/kris/IdeaProjects/krisbitney/polywrap-kt/src/commonMain/kotlin/eth.krisbitney.polywrap/uriResolvers/extendable/UriResolverWrapper.kt:87)
Expected behavior
I expected the map to serialize using the dynamic serializer
Version
Describe the bug I am trying to deserialize this map as
Map<String, Any>
I am getting the "End of Stream" exception thrown at line 31 of
MsgPackDataBuffer
.See: https://github.com/esensar/kotlinx-serialization-msgpack/blob/main/serialization-msgpack/src/commonMain/kotlin/com.ensarsarajcic.kotlinx.serialization.msgpack/stream/MsgPackDataBuffer.kt#L31
Traceback:
Expected behavior I expected the map to serialize using the dynamic serializer