Skip to content

Instantly share code, notes, and snippets.

@mocyuto
Last active October 7, 2016 02:21
Show Gist options
  • Save mocyuto/30c88a43d9d02f0953d0abad84bbda83 to your computer and use it in GitHub Desktop.
Save mocyuto/30c88a43d9d02f0953d0abad84bbda83 to your computer and use it in GitHub Desktop.
Value Class behaves strange
import org.json4s._
import org.json4s.jackson.JsonMethods._
import org.json4s.jackson.Serialization._
Object Temp{
case class Attributes(value: String) extends AnyVal
case class Temp(seq: Seq[Attributes])
def main(args: Array[String]): Unit = {
val a = """ {"seq":["test"]} """
val b = Seq("test")
println(parse(a).extract[Temp])
println(Temp(b.map(c => Attributes(c))))
}
// this behaves such as below
// Temp(List(test))
// Temp(List(Attributes(test)))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment