@JvmName("postTyped")
public inline fun <reified R : Any> <http://Route.post|Route.post>(
crossinline body: suspend PipelineContext<Unit, ApplicationCall>.(R) -> Unit
): Route = post {
body(call.receive())
}
?
I realize there's
receiveNullable
but there's no way to do it via route declaration, only in the body of the route itself 😕
EDIT: Nvm I realize I'm just stupid, I could just make properties inside the route model nullable instead to achieve the same effect :D
h
hfhbd
09/08/2022, 5:44 PM
Main reason: To avoid too many overloads. and you could simple write the extension by yourself 🙂