Playframework [JSON API]: Writting Either[String, Set[String]] into Json

I have a case class

case class Test(value: Either[String, Set[String]])

Usually I use Formats, that works fine. However I do get an error regarding the use of Either. Here, I have a List[Test] and for each value I want “value”: “stringValue” or “value”: [“val1”, “valn”].

What are the options here? Should I extend the Format?