I have the following:
def response() = {
if (value == 1) {
("code" -> "API_001") ~ ("result" -> "OK - Room created")
}
}
JsonResponse(
("response" -> response)
)
But I get the following error:
No implicit view available for Any => net.liftweb.json.package.JValue
Ay help much appreciated, thanks in advance 🙂
def response()is of typeAnybecause yourifclause is (ifvalue != 1, it needs to return(): Unit, so the overall type of the expression is a supertype ofJValueandUnit). You need to add anelseclause which returns an appropriate type.