Hi I am using the following for my api in Lift:
case "api" :: "all" :: _ Get req => for {
val after <- req.param("after")
val before <- req.param("before")
val limit <- req.param("limit")
} yield JsonResponse(json(ResponseLimitAfterBefore(limit.toInt,
after.toString,
before.toString)))
My issue is if any of the three parameters are missing it gives an error. Can anyone help me with how to assign a value to any of them if any parameter is missing? For example if after is not in the url then how can I assign a default value to after?
Thanks, -Faran