I am trying to split format to multiple tuples so it can handle more than 22 fields in the case class. However, I got an error "value and is not a member of play.api.libs.json.Format". How can I merge multiple formats for a case class?
val fields1to2: Format[(Int, String)] = (
(__ \ "a").format[Int] and
(__ \ "b").format[String]
).tupled
val fields3to4: Format[(Boolean, List[Int])] = (
(__ \ "c").format[Boolean] and
(__ \ "d").format[List[Int]]
).tupled
implicit val hugeCaseClassReads: Format[Huge] = (
fields1to2 and fields3to4 // "value and is not a member of play.api.libs.json.Format"
) {
case ((a, b), (c, d)) =>
Huge(a, b, c, d)
}