https://kotlinlang.org logo
#serialization
Title
# serialization
n

neworldlt

07/19/2018, 7:56 PM
What I should do with polymorphic class in JS module? I have custom serializer. With
0.5.0
it worked well. With
0.6.0
compile is crashing with
Can't locate polymorphic serializer definition
s

sandwwraith

07/19/2018, 7:58 PM
Polymorphic serializer wasn’t available in JS on 0.5.0. Can you explain your problem in details in. e.g., GitHub issue?
n

neworldlt

07/19/2018, 8:01 PM
I am not sure, probably it is my problem. I have an entity with:
Copy code
val planets: List<Container<Planet>> = emptyList()
And I have custom serializers in JS and JVM modules
Custom serializer is very simple, it serializes only ID
If I define:
Copy code
@Serializable(with = ContainerSerializer::class)
    val planets: List<Container<Planet>> = emptyList(),
Compiler works, but field is serialized with
ContainerSerializer
So, if I understand correctly,
0.6.0
version does check
polymorphic fields
for JS module and leave no chance to use custom serializer.
I will try to write a test and make PR
5 Views