Jer*_*emy 8 serialization json scala lift
我正在尝试使用lift-json进行基本序列化/水合作用,但没有成功.从包装自述文件中可以看出,这应该可行.救命?
我正在使用Scala 2.8.0和Lift 2.2为sbt交叉构建2.8("net.liftweb"%%"lift-json"%"2.2").
import net.liftweb.json._
import net.liftweb.json.Serialization.{read, write}
implicit val formats = Serialization.formats(NoTypeHints)
case class Route(title: String)
val rt = new Route("x277a1")
val ser = write(rt)
// ser: String = {} ...
val deser = read[Route]("""{"title":"Some Title"}""")
// net.liftweb.json.MappingException: Parsed JSON values do not match with class constructor
Run Code Online (Sandbox Code Playgroud)