diff options
Diffstat (limited to 'src/main/scala/xyz/driver/pdsuidomain/formats/json/criterion')
3 files changed, 12 insertions, 8 deletions
diff --git a/src/main/scala/xyz/driver/pdsuidomain/formats/json/criterion/ApiCriterion.scala b/src/main/scala/xyz/driver/pdsuidomain/formats/json/criterion/ApiCriterion.scala index 0f3b76e..1e7114a 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/formats/json/criterion/ApiCriterion.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/formats/json/criterion/ApiCriterion.scala @@ -26,7 +26,7 @@ object ApiCriterion { (JsPath \ "isCompound").format[Boolean] and (JsPath \ "labels").format(seqJsonFormat[ApiCriterionLabel]) and (JsPath \ "trialId").format[String] - ) (ApiCriterion.apply, unlift(ApiCriterion.unapply)) + )(ApiCriterion.apply, unlift(ApiCriterion.unapply)) def fromDomain(richCriterion: RichCriterion) = ApiCriterion( id = richCriterion.criterion.id.id, diff --git a/src/main/scala/xyz/driver/pdsuidomain/formats/json/criterion/ApiNewCriterion.scala b/src/main/scala/xyz/driver/pdsuidomain/formats/json/criterion/ApiNewCriterion.scala index 85c91d5..604a98b 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/formats/json/criterion/ApiNewCriterion.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/formats/json/criterion/ApiNewCriterion.scala @@ -37,5 +37,5 @@ object ApiNewCriterion { (JsPath \ "text").formatNullable[String] and (JsPath \ "labels").format(seqJsonFormat[ApiCriterionLabel]) and (JsPath \ "trialId").format[String] - ) (ApiNewCriterion.apply, unlift(ApiNewCriterion.unapply)) + )(ApiNewCriterion.apply, unlift(ApiNewCriterion.unapply)) } diff --git a/src/main/scala/xyz/driver/pdsuidomain/formats/json/criterion/ApiUpdateCriterion.scala b/src/main/scala/xyz/driver/pdsuidomain/formats/json/criterion/ApiUpdateCriterion.scala index c73c3ef..2bcda56 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/formats/json/criterion/ApiUpdateCriterion.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/formats/json/criterion/ApiUpdateCriterion.scala @@ -34,15 +34,19 @@ final case class ApiUpdateCriterion(meta: Tristate[String], object ApiUpdateCriterion { private val reads: Reads[ApiUpdateCriterion] = ( - (JsPath \ "meta").readTristate(Reads { x => JsSuccess(Json.stringify(x)) }).map { - case Tristate.Present("{}") => Tristate.Absent - case x => x - } and + (JsPath \ "meta") + .readTristate(Reads { x => + JsSuccess(Json.stringify(x)) + }) + .map { + case Tristate.Present("{}") => Tristate.Absent + case x => x + } and (JsPath \ "arms").readTristate(seqJsonFormat[Long]) and (JsPath \ "text").readNullable[String] and (JsPath \ "isCompound").readNullable[Boolean] and (JsPath \ "labels").readTristate(seqJsonFormat[ApiCriterionLabel]) - ) (ApiUpdateCriterion.apply _) + )(ApiUpdateCriterion.apply _) private val writes: Writes[ApiUpdateCriterion] = ( (JsPath \ "meta").writeTristate(Writes[String](Json.parse)) and @@ -50,7 +54,7 @@ object ApiUpdateCriterion { (JsPath \ "text").writeNullable[String] and (JsPath \ "isCompound").writeNullable[Boolean] and (JsPath \ "labels").writeTristate(seqJsonFormat[ApiCriterionLabel]) - ) (unlift(ApiUpdateCriterion.unapply)) + )(unlift(ApiUpdateCriterion.unapply)) implicit val format: Format[ApiUpdateCriterion] = Format(reads, writes) } |