Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added a helpful convertion to JValue

  • Loading branch information...
commit 8b57a82faba442d4842f23ce30a2d2381d746a18 1 parent 4f4b10a
@dpp dpp authored
View
9 web/webkit/src/main/scala/net/liftweb/http/rest/RestHelper.scala
@@ -43,6 +43,15 @@ trait RestHelper extends LiftRules.DispatchPF {
(in.weightedAccept.isEmpty && in.path.suffix.equalsIgnoreCase("json")) ||
suplimentalJsonResponse_?(in)
}
+
+ /**
+ * Take any value and convert it into a JValue. Full box if
+ * it works, empty if it does
+ */
+ protected def anyToJValue(in: Any): Box[JValue] = Helpers.tryo{
+ implicit def formats = DefaultFormats
+ Extraction.decompose(in)
+ }
/**
* If there are additional custom rules (e.g., looking at query parameters)
Please sign in to comment.
Something went wrong with that request. Please try again.