Question about routing path parameters: Suppose I...
# ktor
c
Question about routing path parameters: Suppose I have a route:
get("/foo/{param1}/bar" { ... }
When I access
call.parameters["param1"]
the type is
String?
. My question is, can this ever actually be null? What situation would lead to a request with no value for
param1
being routed to that handler? (I am avoiding the Locations feature for now since it is marked experimental.)
f
it's probably just because the parameters can't be checked at compile time, you could do
call.parameters["foo"]
without having
{foo}
anywhere in your route (although it could throw an exception in that case instead of returning a nullable)
c
Good point.