hhariri
06/29/2020, 8:06 AMHamza
06/29/2020, 8:08 AMandylamax
06/29/2020, 8:40 AMMatteo Mirk
06/29/2020, 10:13 AM@Route
, @Path
or a more RESTful @Resource
?Casey Brooks
06/29/2020, 2:29 PMrouting { }
block.
I would prefer to simply add a type parameter to a normal route, rather than moving the path info into an annotation. And if this were supported, it seems like it should be part of the core routing feature, not in a separate artifact.
routing {
// original route
get("/list/{name}") {
call.respondText("Listing ${listing.name}, page ${listing.page}")
}
// with static type (all that's changed is the addition of the type parameter)
get<Listing>("/list/{name}") { listing ->
call.respondText("Listing ${listing.name}, page ${listing.page}")
}
}
rharter
06/29/2020, 4:36 PMLocation
is a bit misleading since it is really describing a type-safe Request
. For instance, I’ve been working on some type-safe template support (using freemarker), and the idea of having a type-safe Response
gets a bit conflated with the type-safe. The name Location
sort of hijacks the entire space while only actually serving half of the endpoint location.