diff options
author | Jakob Odersky <jakob@odersky.com> | 2018-03-06 21:39:36 -0800 |
---|---|---|
committer | Jakob Odersky <jakob@odersky.com> | 2018-03-06 21:39:36 -0800 |
commit | 649a22c469647f095b93082a00c01b44fa2a6570 (patch) | |
tree | 8f2eae03194d9808a8e198d6ee29da57797cc6ac /src/test/scala/ProductTypeFormats.scala | |
parent | 20198603150fb2a82451d1397294529e64fe7bfa (diff) | |
download | spray-json-derivation-649a22c469647f095b93082a00c01b44fa2a6570.tar.gz spray-json-derivation-649a22c469647f095b93082a00c01b44fa2a6570.tar.bz2 spray-json-derivation-649a22c469647f095b93082a00c01b44fa2a6570.zip |
Generate RootJsonFormats and remove special handling of case objects
Diffstat (limited to 'src/test/scala/ProductTypeFormats.scala')
-rw-r--r-- | src/test/scala/ProductTypeFormats.scala | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/test/scala/ProductTypeFormats.scala b/src/test/scala/ProductTypeFormats.scala index 9755198..48f1bf1 100644 --- a/src/test/scala/ProductTypeFormats.scala +++ b/src/test/scala/ProductTypeFormats.scala @@ -31,16 +31,16 @@ class ProductTypeFormats "Case object" should behave like checkCoherence( D, - """"D"""" + "{}" ) "Case object as parameter" should behave like checkCoherence( E(D), - """{"d":"D"}""" + """{"d":{}}""" ) // custom format for F, that inverts the value of parameter x - implicit val fFormat: JsonFormat[F] = new JsonFormat[F] { + implicit val fFormat: RootJsonFormat[F] = new RootJsonFormat[F] { override def write(f: F): JsValue = JsObject("x" -> JsNumber(-f.x)) override def read(js: JsValue): F = F(-js.asJsObject.fields("x").convertTo[Int]) |