Last active
August 29, 2015 14:21
-
-
Save alexarchambault/d85e4e7838d8c33f9e28 to your computer and use it in GitHub Desktop.
rapture issue
This file contains hidden or 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
| scalaVersion := "2.11.6" | |
| libraryDependencies ++= Seq( | |
| "com.propensive" %% "rapture-core" % "1.1.0", | |
| "com.propensive" %% "rapture-json-jackson" % "1.1.0" | |
| ) |
This file contains hidden or 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
| [info] Compiling 1 Scala source to /home/alexandre/projects/rapture-ref/target/scala-2.11/classes... | |
| [error] /home/alexandre/projects/rapture-ref/Test.scala:36: Cannot serialize type Dog1[Int] to rapture.json.Json. Please provide an implicit Serializer of type Dog1[Int]. | |
| [error] val dogJS = Json(d).toString | |
| [error] ^ | |
| [error] /home/alexandre/projects/rapture-ref/Test.scala:39: Cannot serialize type DogOwner1 to rapture.json.Json. Please provide an implicit Serializer of type DogOwner1. | |
| [error] val dogOwnerJS = Json(q).toString | |
| [error] ^ | |
| [error] two errors found | |
| [error] (compile:compileIncremental) Compilation failed | |
| [error] Total time: 2 s, completed May 18, 2015 6:35:13 PM |
This file contains hidden or 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
| import rapture.json.jsonBackends.jackson._ | |
| import rapture.json._ | |
| import rapture.core._ | |
| import modes.returnTry | |
| import formatters.humanReadable._ | |
| case class Dog(name: String, age: Int) | |
| case class DogOwner(dog: Dog, name: String) | |
| case class Dog1[T](name: String, age: T) | |
| case class DogOwner1(dog: Dog1[Int], name: String) | |
| object Test extends App { | |
| { | |
| val d = Dog("Tyler", 15) | |
| val q = DogOwner(d, "Frank") | |
| println(d) | |
| println(q) | |
| println(d.age) | |
| val dogJS = Json(d).toString | |
| val aDog = Json.parse(dogJS).as[Dog] | |
| val dogOwnerJS = Json(q).toString | |
| val dogOwner = Json.parse(dogOwnerJS).as[DogOwner] | |
| } | |
| { | |
| val d = Dog1("Tyler", 15) | |
| val q = DogOwner1(d, "Frank") | |
| println(d) | |
| println(q) | |
| println(d.age) | |
| val dogJS = Json(d).toString | |
| val aDog = Json.parse(dogJS).as[Dog1[Int]] | |
| val dogOwnerJS = Json(q).toString | |
| val dogOwner = Json.parse(dogOwnerJS).as[DogOwner1] | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment