Skip to content

Instantly share code, notes, and snippets.

@martende
Last active November 2, 2017 20:28
Show Gist options
  • Save martende/862774a168101181f633275fe504467a to your computer and use it in GitHub Desktop.
Save martende/862774a168101181f633275fe504467a to your computer and use it in GitHub Desktop.
def toJSON[T](o: T)(implicit tjs: Writes[T]): JsValue = tjs.writes(o)
implicit object w2 extends Writes[Document] {
def writes(o: Document) = {
JsObject(o.toMap.map {
x =>
// def implicitly[T](implicit e: T): T = e
val v = toJSON(x._2)
( x._1.toString,v )
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment