Question: Please correct me if I am wrong, but when using Java with say Spring MVC you didn't have to create these extra classes to map your Java class to JSON and JSON to class.

Why do you have to do this in Play with Scala? Is it something to do with Scala?

```
case class Location(lat: Double, long: Double)

implicit val locationWrites: Writes[Location] = (
  (JsPath \ "lat").write[Double] and
  (JsPath \ "long").write[Double]
)(unlift(Location.unapply))

implicit val locationReads: Reads[Location] = (
  (JsPath \ "lat").read[Double] and
  (JsPath \ "long").read[Double]
)(Location.apply _)

```

Answer: 
You don't need to:

```
case class Location(lat: Double, long: Double)

object Location {

  implicit val fmt = Json.format[Location]

}

Json.toJson(Location(4.5, 5.3)) // returns JsValue

```

The hand-written reads/writes/formats are useful when your JSON structure doesn't match your object definition.
Theoretically it's possible to write function with default implicit parameter like 

```
def toJson[T](x: T)(implicit fmt: Reads[T] = Json.format[T]) = Json.toJson(x)(fmt)

```

But in case of Play Json it will not work because Json.format[T] is a macro and it cannot resolve generic-type symbol T. It can resolve only symbols which directly refers to case classes or any with unapply (see [sources](https://github.com/playframework/playframework/blob/master/framework/src/play-json/src/main/scala/play/api/libs/json/JsMacroImpl.scala "sources"))

On the other hand, it seems to be possible to write a macro which generates same function as i described but instead of Apply( Json.format[T]) uses AST from [JsMacroImpl.macroImpl](https://github.com/playframework/playframework/blob/master/framework/src/play-json/src/main/scala/play/api/libs/json/JsMacroImpl.scala "sources")(c, "format", ...). 

Anyway, it's not a language restriction - it's just not implemented in given library.