Hey folks,
First off I'd like to say how awesome Spark is! I've just discovered it and found it to be a real breath of fresh air and it's lots of fun to develop in!
I had a question about parameters and didn't find anything on it in the documentation nor via google. Given a route like this (I used a statement lambda to make it clearer):
get("location/:id", (request, response) -> {
String id = request.params("id");
return JSON.toJson(findLocationTrack(id).orElseThrow(notFoundLocation(id)));
});
Is it possible to bind the path or query variables so they are automatically cast to a type and available for use, something like (pseudo code):
get("location/:id", String id, (id,request, response) -> {
return JSON.toJson(findLocationTrack(id).orElseThrow(notFoundLocation(id)));
});
Hopefully my question is clear enough and thanks for the great framework!