esensar / kotlinx-serialization-msgpack

MsgPack support for kotlinx.serialization -- msgpack.org[kotlinx.serialization]
https://www.ensarsarajcic.com/kotlinx-serialization-msgpack/
MIT License
44 stars 9 forks source link

Update MsgPackDecoder.kt #87

Closed umerov1999 closed 1 year ago

umerov1999 commented 1 year ago

fix class decoder

esensar commented 1 year ago

Hi! Thank you for you PR.

Can you add some description for this? Is there a bug that this PR fixes? If so, can you add some description regarding that bug and if possible a test for it.

umerov1999 commented 1 year ago

Hi! Thank you for you PR.

Can you add some description for this? Is there a bug that this PR fixes? If so, can you add some description regarding that bug and if possible a test for it.

Hi, I attached the archive with test IgnoreUnknowKeys need enable in config

sample.json - this file is messagepack converted to json Test.kt - test decoding [dlg.lastMessage not decoded!] Screenshot_20230130_214638

This is test archive with simulation problem test.zip

esensar commented 1 year ago

Hi, sorry for the long delay.

I just checked out your test and it seems to be working fine after one small update in one of your models.

In VKApiMessage out is defined as a boolean, but it is an integer in the JSON you sent. Parsing fails there, so changing it to a numeric type makes this work.

esensar commented 1 year ago

My bad, when changing to ignoreUnknownKeys it is null as you reported.

esensar commented 1 year ago

Fix will be released in 0.5.4