Joe Joe - 7 months ago 40
Scala Question

cant extract simple json to case class with json4s

im 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}"""



You forgot the implicit val jsonDefaultFormats = DefaultFormats right after your imports.