Skip to content

Instantly share code, notes, and snippets.

package rest.spray.service
import akka.actor.Actor
import reactivemongo.api.MongoDriver
import reactivemongo.bson.{BSONDocument, BSONDocumentReader, BSONObjectID, Macros}
import spray.httpx.SprayJsonSupport._
import spray.json._
import spray.routing._
import scala.concurrent.Future
@edgarmueller
edgarmueller / gist:584c3d1faa933a4cb568
Created January 9, 2015 18:51
Json writes for a superclass in scala
trait PropertyType {
def price: Double
}
case class House(price: Double, noOfBedRooms: Option[Short]) extends PropertyType
case class Land(price: Double, area: Option[Double]) extends PropertyType
object House {
implicit val houseReads: Reads[House] = (
(JsPath \ "price").read[Double] and
package mytest
import org.specs2.execute.Details
import org.specs2.mutable._
import org.specs2.reporter.Notifier
class MyNotifier extends Notifier {
override def exampleFailure(name: String, message: String,