|
@@ -14,10 +14,11 @@ class Application extends Controller {
|
|
|
|
|
|
// Easy ones
|
|
|
case class HelloWorld(message: String)
|
|
|
+ implicit val helloWorldWrites = Json.writes[HelloWorld]
|
|
|
|
|
|
def getJsonMessage = Action {
|
|
|
val helloWorld = HelloWorld(message = "Hello, World!")
|
|
|
- Ok(Json.toJson(helloWorld)(Json.writes[HelloWorld])).withHeaders(CONTENT_TYPE -> "application/json")
|
|
|
+ Ok(Json.toJson(helloWorld)).withHeaders(CONTENT_TYPE -> "application/json")
|
|
|
}
|
|
|
|
|
|
val plaintext = Action {
|
|
@@ -25,4 +26,4 @@ class Application extends Controller {
|
|
|
// BUT the test harness has a WARN state and says we don't need it.
|
|
|
Ok("Hello, World!").withHeaders(CONTENT_TYPE -> "text/plain")
|
|
|
}
|
|
|
-}
|
|
|
+}
|