diesieben07
03/31/2020, 3:13 PMContentNegotiation
feature with Jackson for JSON bodies Ktor responds with HTTP 500 if the client sends invalid JSON or JSON that does not match the data classes I am trying to receive. I would expect HTTP 400 instead. Is there a way to configure this?SerVB
03/31/2020, 3:27 PMdiesieben07
03/31/2020, 3:30 PMinstall(StatusPages) {
exception<JsonProcessingException> {
call.respond(HttpStatusCode.BadRequest, "Invalid JSON")
}
}
Solved it for me. Strange that this isn't the default for Jackson serialization.mp
03/31/2020, 3:44 PMdiesieben07
03/31/2020, 3:46 PMmp
03/31/2020, 3:46 PMdiesieben07
03/31/2020, 3:46 PMmp
03/31/2020, 3:48 PMmp
03/31/2020, 3:49 PMdiesieben07
03/31/2020, 3:53 PM