You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This seems to be an issue in the kotlinx serialization land, but I'm not sure where the boundary ends between Ktor ContentNegotation plugin and Kotlinx serialization.
We have noticed a regression that was introduced with Ktor 2.2.* and kotlinx.serialization 1.4.1+ when serializing/deserializing lists of Contextual types, and it seems to be related to serialization caching.
The regression produces the following error:
Class 'ArrayList' is not registered for polymorphic serialization in the scope of 'List'.
To be registered automatically, class 'ArrayList' has to be '@Serializable', and the base class 'List' has to be sealed and '@Serializable'.
Alternatively, register the serializer for 'ArrayList' explicitly in a corresponding SerializersModule.
kotlinx.serialization.SerializationException: Class 'ArrayList' is not registered for polymorphic serialization in the scope of 'List'.
To be registered automatically, class 'ArrayList' has to be '@Serializable', and the base class 'List' has to be sealed and '@Serializable'.
Alternatively, register the serializer for 'ArrayList' explicitly in a corresponding SerializersModule.
at app//kotlinx.serialization.internal.Abst
We believe the above exception is a byproduct of changes in this pr to implement a caching layer for serializers:
The text was updated successfully, but these errors were encountered:
rasharab
changed the title
Regression with Json ContentNegotation using list of types that we have contextual adapters for
Regression with serialization using list of types that have registered contextual serializers
Jun 8, 2023
…extual types
Fixes#2323
In the current implementation of serializer lookup caching, if the serializer for the parameter was not found, the `serializerOrNull` function always returned null, without further searching for contextual serializers in the current SerializersModule.
…extual types (#2331)
Fixes#2323
In the current implementation of serializer lookup caching, if the serializer for the parameter was not found, the `serializerOrNull` function always returned null, without further searching for contextual serializers in the current SerializersModule.
JesusMcCloud
pushed a commit
to a-sit-plus/kotlinx.serialization
that referenced
this issue
Jul 5, 2023
…extual types (Kotlin#2331)
FixesKotlin#2323
In the current implementation of serializer lookup caching, if the serializer for the parameter was not found, the `serializerOrNull` function always returned null, without further searching for contextual serializers in the current SerializersModule.
This seems to be an issue in the kotlinx serialization land, but I'm not sure where the boundary ends between Ktor ContentNegotation plugin and Kotlinx serialization.
We have noticed a regression that was introduced with Ktor 2.2.* and kotlinx.serialization 1.4.1+ when serializing/deserializing lists of Contextual types, and it seems to be related to serialization caching.
The regression produces the following error:
We believe the above exception is a byproduct of changes in this pr to implement a caching layer for serializers:
2825e21
In particular, this conditional:
https://github.com/Kotlin/kotlinx.serialization/blame/84d4af04a688286ad1b51a72130ccda691caff75/core/commonMain/src/kotlinx/serialization/Serializers.kt#L200
The supplied testbed was working at Ktor 2.1.3 and Kotlinx Serialization 1.4.0.
TESTBED:
You can configure the versions here:
https://github.com/NextChapterSoftware/kotlinx-serialization-bug/blob/cefc82ad210cbd683c8327188f9d8a8d5119af00/kotlinx-serialization-bug/build.gradle.kts#L18
You should run this file:
https://github.com/NextChapterSoftware/kotlinx-serialization-bug/blob/main/kotlinx-serialization-bug/src/test/kotlin/TestSerialization.kt
The text was updated successfully, but these errors were encountered: