diff options
author | Leonid Startsev <sandwwraith@users.noreply.github.com> | 2023-10-19 18:16:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-19 18:16:43 +0200 |
commit | 7d4bb2a80b5ad7f053c8bd5596f7acb33e262114 (patch) | |
tree | 8a9730d886b52d082ebd0c66b57c5b19f84bc499 /formats/json-tests/commonTest/src/kotlinx/serialization/ClassWithMultipleMasksTest.kt | |
parent | cf57414d83314bf05cb28ae8a600163b96855ba0 (diff) | |
download | kotlinx.serialization-7d4bb2a80b5ad7f053c8bd5596f7acb33e262114.tar.gz |
Improve polymorphic deserialization optimization: (#2481)
Previously, when discriminator was found as the first key in Json, but there was no deserializer for it, we still fell back to a slow path with JsonTree.
It was actually meaningless because a slow path always throws exception when a serializer is not found.
Such behavior led to unnecessary memory pressure & consumption in exceptional cases (see linked ticket for details).
Also make polymorphic deserialization exception messages more meaningful and make them more consistent with serialization ones.
Also fix behavior when the actual discriminator value is JsonNull (it should be treated as missing, not as "null" string).
Fixes #2478
Diffstat (limited to 'formats/json-tests/commonTest/src/kotlinx/serialization/ClassWithMultipleMasksTest.kt')
0 files changed, 0 insertions, 0 deletions