I am trying to create Akka Http REST post endpoint mapping the JSON objects to the case class defined
import io.circe.Decoder, io.circe.generic.auto._
case class JobEntity(id: Option[Long] = None, name: String, description: String, json_data :java.sql.blob)
The JSON is of type
{
"id": "124",
"name": "MYJOB",
"description": "Test Job"
}
Now I want to map whole JSON to the 'json_data' as blob defined in the case class
post {
entity(as[JobEntity]) { jobEntity: JobEntity =>
complete(createJob(jobEntity).map(_.asJson))
}
}
I understand .map(_.asJson) would map the json to the JobEntity, Correct me if Its not like this
How do I map the whole JSON to the json_data.