Created
February 10, 2015 18:22
-
-
Save jkinkead/938f87d1f58d182704ba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
implicit val intMapFormat = new JsonFormat[Map[Int, Int]] = { | |
override def write(map: Map[Int, Int]): JsValue = { | |
map.toSeq.toJson | |
} | |
override def read(json: JsValue): Map[Int, Int] = json match { | |
case value: JsArray => value.convertTo[Seq[(Int, Int)]].toMap | |
case _: => "Expected . . . " | |
} | |
} | |
val foo =... | |
implicit val myImplicitFoo = foo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment