Skip to content

tototoshi/lift-json-play-module

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

lift-json module for Play20

This module allows you to use lift-json in your play20 application.

Usage

// your play20 project settings

val main = PlayProject(appName, appVersion, appDependencies, mainLang = SCALA).settings(
  resolvers += "tototoshi.github.com maven-repo/releases" at "http://tototoshi.github.com/maven-repo/releases",
  libraryDependencies ++= Seq(
    "com.github.tototoshi" %% "lift-json-play-module" % "0.1"
  )
)
import com.github.tototoshi.play2.json.LiftJson
import net.liftweb.json._

case class Person(id: Long, name: String, age: Int)

object Application extends Controller with LiftJson {

  implicit val formats = DefaultFormats

  def get = Action { implicit request =>
    Ok(Extraction.decompose(Person(1, "ぱみゅぱみゅ", 20)))
  }

  def post = Action(liftJson) { implicit request =>
    Ok(request.body.extract[Person].name)
  }

}

About

lift-json module for Play20

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages