Skip to content

Instantly share code, notes, and snippets.

@JosephMoniz
Created May 3, 2015 05:21
Show Gist options
  • Save JosephMoniz/b6864ddfd29d3ae7c49e to your computer and use it in GitHub Desktop.
Save JosephMoniz/b6864ddfd29d3ae7c49e to your computer and use it in GitHub Desktop.
An example on how to construct JSON objects
import com.plasmaconduit.json._
val verbose = JsObject(
"key1" -> JsString("value"),
"key2" -> JsInt(42),
"key3" -> JsBoolean(true),
"key4" -> JsArray(JsInt(3), JsBoolean(true))
)
val sugar = JsObject(
"key1" -> "value",
"key2" -> 42,
"key3" -> true,
"key4" -> List[JsValue](3, true)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment