Q:

Unable to parse Json as a Map - Scala/Play

I'm unable to parse the json I'm getting as a Map. Anyone have any ideas? Please do ask if you require any more information. Thanks :)
Trying to parse the following response using:
Json.parse(response.body).as[Map[String, Either[List[ErrorMsg], Seq[OepPoint]]]]

Response:
{
  "Payout": {
    "errors":[
      {
        "field": "Last point: OepPoint(0.033,72.14). Current: OepPoint(0.033,65.71)",
        "message":"OEP must be unique"
      }
    ],
    "curve":[]
  }
}

Error Message thrown is:
No Json deserializer found for type Map[String,Either[List[ErrorMsg],Seq[OepPoint]]]. Try to implement an implicit Reads or Format for this type.
[error]     val errorExpected = Json.parse(response.body).as[Map[String, Either[List[ErrorMsg], Seq[OepPoint]]]]
[error]                                                     ^
[error] one error found

Structure of OepPoint:
case class OepPoint(oep: Double, loss: Double)

object OepPoint {
   implicit val oepPointReads = Json.format[OepPoint]
 }

Structure of ErrorMsg:
case class ErrorMsg(field: String, message: String)

object ErrorMsg {
  implicit val errorMsgReads = Json.format[ErrorMsg]
}

A:

Assuming you have proper Reads for OepPoint and ErrorMsg. You can do following.
case class ErrOrOep( errors: List[ ErrorMsg ], curve: List[ OepPoint ] )

implcit val errOrOepFormat = Json.format[ ErrOrOep ]

val jsonMap = Json.parse(response.body).as[ Map[String, ErrOrOep ] ]

val errOrOep = jsonMap( "Payout" )

val oepEither: Either[ List[ ErrorMsg ], List[ OepPoint ] ] = 
  ( errOrOep.errors, errOrOep.curve ) match {
    case ( _, h :: _ ) => Right( errOrOep.curve )
    case ( h :: _, _  ) => Left( errOrOep.error )
    case ( _, _ ) => Left( errOrOep.error )
  }

