I'm measuring 3-4 ms serialization time of simple JSON. Is this the performance to expect from AKKA or is there something that can be done to rectify it?
case class Response(msg: String)
implicit val format = jsonFormat(Response)
def…
I'm using spray-json and I need to parse the given request body (PATCH, POST), request body attributes can have following possibilities represented by Either[Unit.type, Option[A]]
value Not given Left[Unit.type]
value=null Null …
I have a json file which has two types of data for store and online.But datatypes of few columns are different ,but column names and schema are same.
I would like to do some operations on json like sorting,re-arranging using spray joson library in…
Example:
I have the below sample code:
import spray.json._
import gnieh.diffson.sprayJson._
val patchString1 = """[{"op": "replace", "path": "/emails","value":["xxx@yyy.com"] }]"""
val patchString2 = """[{"op": "replace", "path":…
I have a key-value pair where the value is an untyped Javascript array:
{"data": [1, "abc", 54.0, "cdf"]}
I want to convert the value to a Seq[Any] in Scala.
Seq(1, "abc", 54.0, "cdf")
So far I've tried:
val jsonString =…
I have a json
{
"last_updated": "2018-06-04T02:44:54Z",
"result": {
"marks": {
"math": 45.4,
"physics": 13.5,
"bio": 6.3
}
}
}
Now to map above json shall I create multiple case classes or we should read it manually in spray…
What imports are needed to locate the implicit evidence to compile a call to GeoJson.parse from GeoTrellis?
geotrellis.vector.io.json.Geometry uses spray.json to parse, and must be able to locate a JsonReader or JsonFormats instance, templated to…
I have following classes
import spray.json._
sealed trait Base
case class Foo[K, V](key : K, value : V) extends Base
case class Bar[K, V](key : V, value : K) extends Base
their corresponding json convertors
implicit def baseJsonConvertor[K:…
What I'm trying to do in Scala 2.11 and akka is have one case class but two different validations based on which route is being hit.
For example, let's consider the case class below
case class User(_id: String, name: String, age: Int, address:…
I am using Spray json and converting http response to json object in following way and fetching value of WebId key from it:
val json = http_response.body.parseJson
val web_id = json.asJsObject().getFields("WebId")
println(web_id(0))
The output of…
Using Spray JSON, I would like to be able to parse an array of String, but still be able to deserialize correctly if a single String comes.
That is, with this field:
arrayval: List[String]
and this JSON:
arrayval: ["a", "b"]
it would create a…
The below code is unable to find JsonWriter or JsonFormat type class:
import com.typesafe.scalalogging.LazyLogging
import spray.json._
case class MatcherRequest2(dataType:String, testType:String)
object MatcherWriterJsonSupport2 extends…
I've been through the docs and many questions on SO, still can't figure out what I'm doing wrong.
I'm starting with a vanilla akka http g8 template, but I want to use a trait rather than a case class to represent the objects which are coming in POST…
I have a json that sometimes returns List[List[x, y], List[a, b]] or if there is only one then List[x, y] ?
My case class defines
case class Geometry(dataType: String, coordinates: List[List[BigDecimal]])
Exception in thread…