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