Skip to content

Instantly share code, notes, and snippets.

@LeifWarner
Created August 24, 2012 21:11
Show Gist options
  • Save LeifWarner/3455659 to your computer and use it in GitHub Desktop.
Save LeifWarner/3455659 to your computer and use it in GitHub Desktop.
Lift-json decomposition / extraction
import net.liftweb.json.{Extraction, DefaultFormats}
object Main {
implicit val formats = DefaultFormats
val p = Person("Leif", 33)
def main(args:Array[String]) {
val dp = Extraction decompose p
println(dp)
val rp = dp.extract[Person]
println(rp)
}
}
case class Person(name: String, age: Int)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment