Laurent Thiebaud
03/11/2025, 1:32 PMAleksei Tirman [JB]
03/11/2025, 2:14 PMLaurent Thiebaud
03/11/2025, 2:23 PMLaurent Thiebaud
03/11/2025, 2:24 PMAleksei Tirman [JB]
03/11/2025, 2:30 PMLaurent Thiebaud
03/11/2025, 2:35 PMinstall(ContentNegotiation) Httpp
Reusing the example of the plugin we have serializable data classes
@Serializable
data class Customer(val id: Int, val firstName: String, val lastName: String)
And ktor does the deserialization automatically
post("/customer") {
val customer = call.receive<Customer>()
In this example, I'd like firstName
and lastName
to be sanitized
I'd like to set it up at one place and make it work for all routesAleksei Tirman [JB]
03/11/2025, 2:39 PMinit
block of the Customer
class.hellman
03/12/2025, 7:57 AM