forAll("input") { i: Product => val json = s"""{ |"id": ${i.id.asJson.noSpaces}, |"names": ${i.names.asJson.noSpaces} |}""".stripMargin withClue(s"Unable to decode JSON: $json") { decode[Product](json) match { case Left(e) => fail(e.getMessage) case Right(v) => v must be(i) } } }