diff options
author | Jakob Odersky <jakob@odersky.com> | 2018-02-14 12:17:15 -0800 |
---|---|---|
committer | Jakob Odersky <jakob@odersky.com> | 2018-02-14 12:17:15 -0800 |
commit | eada4c48b3954241e130f5d9b5e7feebe8c1e3f2 (patch) | |
tree | d017b30fb264b0560cbf7df3540f26e705da8ec0 /src/main/scala/CustomFormats.scala | |
parent | af6845cc08ae223ad67ebad61559d8264fd3346b (diff) | |
download | spray-json-derivation-eada4c48b3954241e130f5d9b5e7feebe8c1e3f2.tar.gz spray-json-derivation-eada4c48b3954241e130f5d9b5e7feebe8c1e3f2.tar.bz2 spray-json-derivation-eada4c48b3954241e130f5d9b5e7feebe8c1e3f2.zip |
Prepare for releasing
Diffstat (limited to 'src/main/scala/CustomFormats.scala')
-rw-r--r-- | src/main/scala/CustomFormats.scala | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/src/main/scala/CustomFormats.scala b/src/main/scala/CustomFormats.scala deleted file mode 100644 index 3656e3b..0000000 --- a/src/main/scala/CustomFormats.scala +++ /dev/null @@ -1,19 +0,0 @@ - -import spray.json._ - -trait CustomFormats extends DefaultJsonProtocol { - - implicit val fooFormat: JsonFormat[Foo] = new JsonFormat[Foo] { - def read(number: JsValue) = number match { - case JsNumber(x) => Foo(-x.toInt) - case tpe => sys.error(s"no way I'm reading that type $tpe!") - } - def write(number: Foo) = JsNumber(-number.x) - } - - implicit val z: JsonFormat[B] = new JsonFormat[B] { - def read(x: JsValue) = B("gone") - def write(x: B) = JsObject("a" -> JsString("A")) - } - -} |