I need to parse a json into a couple possible case classes:
trait Request {...}
case class RequestOne(...) extends Request
case class RequestTwo(...) extends Request
I created a request wrapper:
trait RequestModel {
type T <: Request
def parse(input: JValue): T = input.extract[T]
}
object RequestOneModel extends RequestModel {
type T = RequestOne
}
object RequestTwoModel extends RequestModel {
type T = RequestTwo
}
With an idea to have RequestModels with the type [T] to parse to inside them.
The code above throws "No Manifest available for RequestModel.this.T."