score:0

Accepted answer

By having a look at the documentation, it's visible that JsObject companion extends (Seq[(String, JsValue)]) ⇒ JsObject, so rather than calling Json.obj (with extra conversion):

import play.api.libs.json._

def foo(fields: List[(String, JsValue)]): JsObject = JsObject(fields)

score:0

I don't know that specific library, but this should break the list into a set of separate arguments:

Json.obj(listOfFields:_*)

Related Query

More Query from same tag