spray/spray-json — pull request #35 by ConnorDoyle (2012-11-28 19:25:09+00:00)
Title: Empty case class support via ProductFormats.jsonFormat0

Added a jsonFormat0 method to ProductFormats.scala to support empty case classes, for completeness. Empty case classes are sometimes preferable to case objects, e.g. when integrating with Java code.

```
scala> import spray.json._
import spray.json._

scala> case class Empty()
defined class Empty

scala> object MyJsonProtocol extends DefaultJsonProtocol {
| implicit val emptyFormat = jsonFormat0(Empty)
| }
defined module MyJsonProtocol

scala> import MyJsonProtocol._
import MyJsonProtocol._

scala> val json = Empty().toJson
json: spray.json.JsValue = {}

scala> val empty = json.convertTo[Empty]
empty: Empty = Empty()
```