I'm trying to use json4s
in a worksheet to try it out, I want simply to extract a json to some case class:
import org.json4s.native.JsonMethods
import org.json4s.{DefaultFormats, Extraction, JValue}
case class Person(name: String, age: Int)
val json = """{"name":"joe","age":15}"""
JsonMethods.parse(json).extract[Person]
You forgot the implicit val jsonDefaultFormats = DefaultFormats
right after your import
s.