I am trying to map the case class to the JSON Using the akka Http
import akka.http.scaladsl.model.StatusCodes
import akka.http.scaladsl.server.Directives._
import akka.http.scaladsl.server.PathMatchers.IntNumber
import de.heikoseeberger.akkahttpcirce.CirceSupport
import io.circe.generic.auto._
import io.circe.syntax._
case class JobEntity(id: Option[Long] = None, name: String, description: String)
Then for Routing
post {
entity(as[JobEntity]) { jobEntity: JobEntity =>
complete(createJob(jobEntity).map(_.asJson))
}
}
This maps my JSON to the JobEntity but problem lies with another use case where my case class is
case class JobEntityNew(id: Option[Long] = None, name: String, description: String, jsonRaw :java.sql.blob)
The JsonRaw needs to pass the json as blob for which I am struggling as to how do I map whole json to the case class apart from other arguments .