summaryrefslogtreecommitdiff
path: root/formats/json-tests/commonTest/src/kotlinx/serialization/ClassWithMultipleMasksTest.kt
diff options
context:
space:
mode:
authorLeonid Startsev <sandwwraith@users.noreply.github.com>2023-10-19 18:16:43 +0200
committerGitHub <noreply@github.com>2023-10-19 18:16:43 +0200
commit7d4bb2a80b5ad7f053c8bd5596f7acb33e262114 (patch)
tree8a9730d886b52d082ebd0c66b57c5b19f84bc499 /formats/json-tests/commonTest/src/kotlinx/serialization/ClassWithMultipleMasksTest.kt
parentcf57414d83314bf05cb28ae8a600163b96855ba0 (diff)
downloadkotlinx.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