Not sure if put this here or in Ktor I have a cus...
# serialization
j
Not sure if put this here or in Ktor I have a custom sealed class which works perfectly via local strings and ktor request if I use my custom serializer
@Serializable(with = CustomSealedClassSerializer::class)
. But I want to remove the dependency on
json
this sealed class in that Gradle module so I tried to use a
SerializerModule
Copy code
Json {
    serializersModule = SerializersModule {
        contextual(CustomSealedClassSerializer::class) { args -> CustomSealedClassSerializer(args[0], args[1] }
    }
    ...
}
This is working perfectly with local strings, but with Ktor
2.0.0-alpha-1
and doing a request, it is not working, and debugging I am getting that
args
list is empty. Is there any workaround?
d
Sounds like a #ktor problem.
a
Does it work with Ktor 1.6.7? Could you please share a code snippet to reproduce this issue?
j
Ktor 2.0.0-beta-1
I will create a minimum repro
a
There is only beta version 🙂
j
Ah yeah, beta-1 I forgot the correct stage
@Aleksei Tirman [JB] I created an issue in YouTrack, here is the link: https://youtrack.jetbrains.com/issue/KTOR-3782