You need to make sure that the implicit JsonFormat
for the Cluster
type is in scope, so that SprayJsonSupport
knows how to marshall that type. With that you should automatically get support for marshaling List[Cluster]
from the default formats.
In the posted code val impCluster = jsonFormat2(Cluster)
defines the JsonFormat
, but it is not marked as implicit
, so the typeclass cannot be implicitly resolved. Changing it to
implicit val impCluster = jsonFormat2(Cluster)
should fix the issue.