I've managed to follow the REST docs so far, but now I want to add a piece of validation that rejects unrecognised Req params. I couldn't see anything that did this in the docs, only the enforcement of manadatory params.
When I try to return a:
ParamFailure("Unrecognized parameters: " + illegalParams, 400)
I get:
[error] /home/gravelld/scala/lift/d6y-lift_24_sbt-0d46974/src/main/scala/com/onemusicapi/api/Api.scala:37: ambiguous implicit values:
[error] both method conforms in object Predef of type [A]=> <:<[A,A]
[error] and lazy value convertJsonXmlAble in trait RestHelper of type => PartialFunction[(net.liftweb.http.rest.JsonXmlSelect, net.liftweb.http.rest.JsonXmlAble, net.liftweb.http.Req),net.liftweb.http.LiftResponse]
[error] match expected type Nothing => net.liftweb.http.LiftResponse
[error] case _ => ParamFailure("Unrecognized parameters: " + illegalParams, 400)
[error] ^
Wider context:
val illegalParams = S.request.map(_.params.keySet).getOrElse(Set.empty).diff(PARAMS)
illegalParams toSeq match {
case Seq() => {
/* serve request */ : JValue
}
case _ => ParamFailure("Unrecognized parameters: " + illegalParams, 400)
}
I've tried different incantations of Boxes, Seqs and the like but no good.
Dan