we're having issues serializing request bodies now...
# ktor
f
we're having issues serializing request bodies now after this change included in the latest release:
Serialization failure (kotlinx.serialization.SerializationException: Serializer for class 'Any' is not found.
the try catch was making a difference for us and now that it's gone we're getting this error, even though everything was working fine before — any chance there might be something missing there? I'm a bit confused because before
result
was clearly nullable (because of the catch clause) and the rest of the logic made sense, but
serializerFromTypeInfo
doesn't return nullable (only maybe
KSerializer<T?>
), so it looks a bit off now
I'll continue investigating and will file an issue when I have a better understanding on what's going on, but I thought I'd share my early findings here just in case
🦆 we managed to work around that by embracing generics a bit more and dropping
Any
in a couple of places
👍 2
d
We're seeing the same issue when updating to 2.2.4. in our case we're retrieving the response first, parse some headers and do some logic before mapping to a typed response. The exception occurs while executing the response and before mapping response body. Maybe we can also solve it by embracing generics more, though at first glance code and ktor config looks decent enough.
a
Can you please file an issue with a code snippet attached?