JsValueWrapper

play.api.libs.json.Json.JsValueWrapper
sealed trait JsValueWrapper

Next is the trait that allows Simplified Json syntax :

Example:

import play.api.libs.json._

JsObject(Seq(
  "key1" -> JsString("value"),
  "key2" -> JsNumber(123),
  "key3" -> JsObject(Seq("key31" -> JsString("value31")))
)) == Json.obj(
 "key1" -> "value", "key2" -> 123, "key3" -> Json.obj("key31" -> "value31"))

JsArray(Seq(JsString("value"), JsNumber(123), JsBoolean(true))) == Json.arr("value", 123, true)

There is an implicit conversion from any Type with a Json Writes to JsValueWrapper which is an empty trait that shouldn't end into unexpected implicit conversions.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
In this article