Hello, I'm experiencing some issues with Ktor serv...
# ktor
j
Hello, I'm experiencing some issues with Ktor server & client when it comes to serializing and deserializing (all serializers). When the type to be serialized or deserialized is
String
Ktor does not serialize or deserialize it, not on the server side or the client side. I've had to add helper methods to send and accept JSON:
a
That's an intended behavior until Ktor 3.0.0. You can make objects of the
String
type serializable and deserializable in the same way as for other objects by removing it from the ignored types:
Copy code
install(ContentNegotiation) {
    removeIgnoredType(String::class)
}
j
I understand! Thank you! Is there an issue for this I can reference to for documentation?
a
j
Thank you very much ❤️
The workaround does not seem to work when returning a response from ktor-server
a
What method do you call to respond?
j
call.respondNullable
I am unable to change this because the part of the application that responds is controlled by an internal web framework that builds on top of Ktor
This is the respondNullable with the workaround applied
a
Unfortunately, I cannot reproduce your problem with
respondNullable
or
respond
Can you try that on a sample project?
j
I apologize! This is my bad!
There are three different locations where this should've been applied for us, it was only applied on two of them which was in testing modules and not in the actual ktor part of the module!
It almost works as expected, I'm having some issues with external modules, please let me double check to see if the changes was applied there too
Nevermind, it is with the test client. Give me a moment to try and figure that one out
Great! Everything is working as expected! There was one undocumented #wtf-ktor left. It has been set to use the workaround now!
Thank you Aleksei!