Closed nafg closed 10 years ago
Currently only Seq[JsExpr] is supported. I suppose you could do xs.map(inject) but with the following any Seq[A] where A can be serialized is supported.
Seq[JsExpr]
implicit def seqJsSerializer[A, S[X] <: Seq[X]](implicit ev: JsSerializer[A]): JsSerializer[S[A]] = new JsSerializer[S[A]] { def apply(a: S[A]) = JsArray(a.map(ev.apply(_)).toList) }
To support the currently supported Seq[JsExpr] you may want to add
implicit object exprJsSerializer extends JsSerializer[JsExpr] { def apply(a: JsExpr) = a }
Oh. But that last implicit would break the inject(JsAny) overload.
Which is probably a good thing. It should have a different name, maybe include.
Should work.
Currently only
Seq[JsExpr]
is supported. I suppose you could do xs.map(inject) but with the following any Seq[A] where A can be serialized is supported.To support the currently supported Seq[JsExpr] you may want to add