https://kotlinlang.org logo
#ktor
Title
m

Mario Andhika

08/02/2023, 10:25 AM
Copy code
install(ContentNegotiation) {
            json(Json {
                namingStrategy = JsonNamingStrategy.SnakeCase
            }
}
I installed this and it works for deserializing snake case JSON data from responses to data classes. But it doesn’t serialize request parameters as shown below from camel case to snake case.
Copy code
@Resource("resetpassword")
class ResetPasswordRequest(val emailAddress: String)
How do I serialize these parameters from camel case to snake case?
a

Aleksei Tirman [JB]

08/02/2023, 10:27 AM
I suggest asking this question in the #serialization channel
👍 1
r

Rustam Siniukov

08/03/2023, 8:21 AM
Resources
plugin do not use
kotlinx-serialization
library. You can create a feature request in YT to support different serialization strategies for resources
3 Views