Skip to content

Instantly share code, notes, and snippets.

@tkawachi
Created May 23, 2015 07:27
Show Gist options
  • Save tkawachi/943599e222ef9ccdf864 to your computer and use it in GitHub Desktop.
Save tkawachi/943599e222ef9ccdf864 to your computer and use it in GitHub Desktop.
implicit def longMapWrites[V](implicit fmtv: Writes[V]): OWrites[collection.immutable.Map[Long, V]] = OWrites[collection.immutable.Map[Long, V]] { ts =>
JsObject(ts.map { case (k, v) => (k.toString, Json.toJson(v)(fmtv)) }.toList)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment