Этот код:
import spray.json._
val str =
"""{"CATEGORY": "reference",
"AUTHOR": "Nigel Rees",
"TITLE": "Sayings of the Century",
"PRICE": 8.95}"""
def main(args: Array[String]) : Unit =
println(JsObject(str.parseJson.asJsObject.fields.map(el => el._1.asInstanceOf[String].toLowerCase -> el._2 )))
дает:
{"author":"Nigel Rees","category":"reference","price":8.95,"title":"Sayings of the Century"}
При следующей зависимости в sbt:
"com.typesafe.akka" %% "akka-http-spray-json" % "10.1.8"