diff --git a/play-json/shared/src/main/scala/play/api/libs/json/Writes.scala b/play-json/shared/src/main/scala/play/api/libs/json/Writes.scala index 8872c2fd..7deadf4f 100644 --- a/play-json/shared/src/main/scala/play/api/libs/json/Writes.scala +++ b/play-json/shared/src/main/scala/play/api/libs/json/Writes.scala @@ -366,7 +366,7 @@ trait DefaultWrites extends LowPriorityWrites with EnumerationWrites { * Serializer for Map[String,V] types. */ @deprecated("Use `genericMapWrites`", "2.8.0") - implicit def mapWrites[V: Writes]: OWrites[MapWrites.Map[String, V]] = MapWrites.mapWrites + def mapWrites[V: Writes]: OWrites[MapWrites.Map[String, V]] = MapWrites.mapWrites implicit def keyMapWrites[K: KeyWrites, V: Writes, M[K, V] <: MapWrites.Map[K, V]]: OWrites[M[K, V]] = { val kw = implicitly[KeyWrites[K]] diff --git a/play-json/shared/src/test/scala/play/api/libs/json/WritesSharedSpec.scala b/play-json/shared/src/test/scala/play/api/libs/json/WritesSharedSpec.scala index f8c76508..728b0fef 100644 --- a/play-json/shared/src/test/scala/play/api/libs/json/WritesSharedSpec.scala +++ b/play-json/shared/src/test/scala/play/api/libs/json/WritesSharedSpec.scala @@ -84,6 +84,10 @@ final class WritesSharedSpec extends AnyWordSpec with Matchers { "write lazy maps" in { Json.toJson(Map("a" -> 1).map(kv => kv._1 -> (kv._2 + 1))).mustEqual(Json.obj("a" -> 2)) } + + "write a map nested in a seq" in { + Json.toJson(Seq(Map("a" -> 1))).mustEqual(Json.arr(Json.obj("a" -> 1))) + } } "Iterable writes" should {