Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

so_22953741

View repl.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
[info] Starting scala interpreter...
[info]
Welcome to Scala version 2.10.4 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0).
Type in expressions to have them evaluated.
Type :help for more information.
 
scala> import spray.json._
import spray.json._
 
scala> import DefaultJsonProtocol._
import DefaultJsonProtocol._
 
scala> :paste
// Entering paste mode (ctrl-D to finish)
 
object Foo extends DefaultJsonProtocol {
implicit val fooFormat = jsonFormat1(Foo.apply)
}
case class Foo(bar: String)
 
// Exiting paste mode, now interpreting.
 
defined module Foo
defined class Foo
 
scala> Foo("baz").toJson
res0: spray.json.JsValue = {"bar":"baz"}
View repl.txt
1 2 3 4 5 6 7 8 9
import spray.json._
import DefaultJsonProtocol._
 
object Foo extends DefaultJsonProtocol {
implicit val fooFormat = jsonFormat1(Foo.apply)
}
case class Foo(bar: String)
 
Foo("baz").toJson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.