title: Return valid JSON data from Cassandra (Akka HTTP)
body: <p>Data from Cassandra database is coming back as invalid JSON despite having the JSON flag in the SELECT statement.</p>
  
  <p>Here is what I receive:</p>
  
  <p>When my front-end receives this it is of course considered invalid JSON. Also I'm not sure why <code>"[json]"</code> is there.</p>
  
  <pre><code>Future(Success(["[json]":'{"pasta_name": "conchiglie", "id": 2, "description": "description for conchiglie", "image": {"alt": "alt text", "src": "image.jpg"}}']))
  
  </code></pre>
  
  <p>Here's what I would like to receive:</p>
  
  <pre><code>{
      "pasta_name": "conchiglie",
      "id": 2, "description":
      "description for conchiglie",
      "image": 
          {
              "alt": "alt text", 
              "src": "image.jpg"
          }
  }
  
  </code></pre>
  
  <p>Here is my simplified code</p>
  
  <pre><code>object Server extends App {
  
  implicit val system: ActorSystem = ActorSystem("helloworld")
  implicit val executor: ExecutionContext = ExecutionContext.global
  implicit val materializer: ActorMaterializer = ActorMaterializer()
  
  val sessionSettings = CassandraSessionSettings()
  implicit val cassandraSession: CassandraSession =
      CassandraSessionRegistry.get(system).sessionFor(sessionSettings)
  
  val recipes: Future[String] =
      CassandraSource(s"SELECT JSON * FROM danlough.recipe_by_pasta").map(row =&gt; row.getFormattedContents()).runWith(Sink.head)
  
  import akka.http.scaladsl.server.Directives._
    def route = path("getRecipe") {
      get {
        respondWithHeaders(RawHeader("Access-Control-Allow-Origin", "http://localhost:3000"), RawHeader("Vary", "Origin")) {
          complete(recipes)
        }
      }
    }
  
  Http().bindAndHandle(route, host, port)
  </code></pre>