Create a gist now

Instantly share code, notes, and snippets.

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