My Mongo DB abstract Dao is defined as follows
abstract class DbMongoDAO1[K, T <: Keyable[K]] (implicit val manifestT: Manifest[T], val manifestK: Manifest[K])
extends DbDAO[K, T]
with DbDAOExtensions[K, T]
with MongoConnection2
…
I am using the code snip from spray json deserialize in my scala code. https://github.com/spray/spray-json
import spray.json._
import DefaultJsonProtocol._
object MyJsonProtocol extends DefaultJsonProtocol {
implicit object…
this is fragment of my router in spray based service:
path(baseUrl / version / "apps" / Segment / "users" / Segment) { (app, user) =>
respondWithMediaType(MediaTypes.`application/json`) { ctx =>
createProxy(ctx, management, GetUser(appId =…
I build server with akka-http and akka-stream but it lost some request in 2K+ request. What I miss something or my understand for akka is wrong.
this is my code
implicit val actorRef = ActorSystem("system", testConf)
implicit val materializer =…
I'm currently going through the akka-http documentation & examples. I'm stuck on probably something very trivial: passing in route-configuration with Directives and JsonSupport. I'm following the docs on introduction and json-support
For the…
How do you use RootJsonFormat with Generics?
Do I have to copy paste every possibility like this:
trait IDJsonSupport
extends SprayJsonSupport
with DefaultJsonProtocol{
implicit object AddressIDFormat extends RootJsonFormat[ID[Address]] {
…
I get a Json feed back from a remote third party API in this way:
val myjson: Future[HttpResponse] = http.singleRequest(HttpRequest(uri = encodedUri))
myjson onComplete {
case Success(response) => sender !…
Is it possible with Akka (maybe some Spray "utils"?) to build a compact json feed starting from a case class like this:
case class Stuff (val1: String, val2: String, val3: String)
built in this way:
Stuff("one value", "", "another value")
and get a…
I've built a RESTful API using Spray.io.
It contains a number of endpoints, each of which returns JSON.
I use the Spray JSON marshaller to marshal my internal objects to JSON which are returned to the user. So I have something similar…
I have case class
case class CreateOffer(playerId: Option[PlayerId], modifier: Double, expiry: DateTime, start: DateTime, notification: String)
When I try in test to Post this in spray
val req = Post("/create", createOffer) ~>
…
I tried converting Map[String, Map[String, Any]] in Scala to JSON but since they have nested maps so unable to do it. Is there a way to do it? I tried looking at this link but it converts everything to string and converts a list as "List(...)". Any…
I am having trouble adding an implicitly defined type converter for a type for which I also have a Json format. I doubt if the problem has anything to do with Json (or Spray). Or MyDate for that matter.
Here's a fragment of code which leads to the…
I've noticed while trying to write a jsonProtocol for my case classes that I get errors with nested case classes. Whereas, if I decouple the case classes and just create one giant case class, with all the fields, it will work fine.
case class…
In my app I'm using https://github.com/fommil/spray-json-shapeless library for serializaion, but I have problem with this class:
case class FooResult(var id: Option[String], jobId: String, completedAt: DateTime, result: JsValue) extends…
Since I'm new to Akka-HTTP, I tried to implement JSON in Akka-HTTP using Marshalling and get POST data from client. But the code is generating error:
The request content was malformed:
Unexpected end-of-input at input index 0 (line 1, position 1),…