Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Mar 31 17:23

    hseeberger on master

    Update sbt to 1.3.9 (#419) (compare)

  • Mar 31 17:23
    hseeberger closed #419
  • Mar 31 16:53
    scala-steward opened #419
  • Mar 30 07:24

    hseeberger on master

    Update jsoniter-scala-core, ...… (compare)

  • Mar 30 07:24
    hseeberger closed #418
  • Mar 30 04:18
    scala-steward opened #418
  • Mar 29 17:33

    hseeberger on master

    Update jsoniter-scala-core, ...… (compare)

  • Mar 29 17:33
    hseeberger closed #417
  • Mar 29 14:21
    scala-steward opened #417
  • Mar 28 09:40

    hseeberger on master

    Update jsoniter-scala-core, ...… (compare)

  • Mar 28 09:40
    hseeberger closed #416
  • Mar 28 09:16
    scala-steward opened #416
  • Mar 21 23:24

    hseeberger on master

    Update jsoniter-scala-core, ...… (compare)

  • Mar 21 23:24
    hseeberger closed #415
  • Mar 21 19:15
    scala-steward opened #415
  • Mar 14 08:40

    hseeberger on master

    Update argonaut to 6.2.5 (#414) (compare)

  • Mar 14 08:40
    hseeberger closed #414
  • Mar 14 07:26
    scala-steward opened #414
  • Mar 13 15:53

    hseeberger on master

    Update akka-stream to 2.6.4 (#4… (compare)

  • Mar 13 15:53
    hseeberger closed #413
Matthew de Detrich
@mdedetrich
akka-stream-json claims to be a pure streaming implementation that uses Jawn directly, how does akka-http-json compare in this regard?
Luke Wyman
@lukewyman
Hi all - I'm using akka-http-circe 1.20.0 with circe 0.9.3 and getting the following run-time error when GET-ting an entity:
ERROR: 2018-03-28 12:16:39,121: akka.actor.ActorSystemImpl => Error during processing of request: 'Unsupported Content-Type, supported: application/json'. Completing with 500 Internal Server Error response. To change default exception handling behavior, provide a custom ExceptionHandler. 
akka.http.scaladsl.unmarshalling.Unmarshaller$UnsupportedContentTypeException: Unsupported Content-Type, supported: application/json
    at akka.http.scaladsl.unmarshalling.Unmarshaller$UnsupportedContentTypeException$.apply(Unmarshaller.scala:158) ~[akka-http_2.12-10.0.10.jar:na]
    at akka.http.scaladsl.unmarshalling.Unmarshaller$EnhancedFromEntityUnmarshaller$.$anonfun$forContentTypes$3(Unmarshaller.scala:114) ~[akka-http_2.12-10.0.10.jar:na]
    at akka.http.scaladsl.unmarshalling.Unmarshaller$$anon$1.apply(Unmarshaller.scala:58) ~[akka-http_2.12-10.0.10.jar:na]
    at akka.http.scaladsl.unmarshalling.Unmarshaller.$anonfun$transform$3(Unmarshaller.scala:23) ~[akka-http_2.12-10.0.10.jar:na]
    at akka.http.scaladsl.unmarshalling.Unmarshaller$$anon$1.apply(Unmarshaller.scala:58) ~[akka-http_2.12-10.0.10.jar:na]
    at akka.http.scaladsl.unmarshalling.Unmarshaller.$anonfun$transform$3(Unmarshaller.scala:23) ~[akka-http_2.12-10.0.10.jar:na]
    at akka.http.scaladsl.unmarshalling.Unmarshaller$$anon$1.apply(Unmarshaller.scala:58) ~[akka-http_2.12-10.0.10.jar:na]
    at akka.http.scaladsl.unmarshalling.Unmarshal.to(Unmarshal.scala:25) ~[akka-http_2.12-10.0.10.jar:na]
Jens Grassel
@jan0sch

Hi anyone doing tagless final with akka-http?

We have something like this:

class Service[F[_]: Monad](repo: Repository[F]) {
  def test: Route = path("foo") {
    get {
      complete {
        for {
          so <- repo.loadSession()  // returns an Option[Session]
        } yield so
      }
    }
  }
}

However the compiler complains about a type mismatch:

found   : F[Option[Session]]
required: akka.http.scaladsl.marshalling.ToResponseMarshallable
    so <- repo.loadSession()

Any advise? Do we have to roll our own marshalling?

Olli Helenius
@liff
@jan0sch you'll have to provide a way to marshal responses from yourF
Jens Grassel
@jan0sch
But how? ;-)
Olli Helenius
@liff
something like implicit def fToResponseMarshaller[A: ToResponseMarshaller]: ToResponseMarshaller[F[A]] = ???
i think...
Jens Grassel
@jan0sch
Okay, so something that abstracts away the F so that the regular marshalling can do its work?
Olli Helenius
@liff
something like that yeah
the compiler only knows your F is a Monad, so you'll need to also provide some way to marshal things from within your F
Jens Grassel
@jan0sch
Thanks, I'll try my luck and will report back here if I have something that works. Might be useful for others too.
Olli Helenius
@liff
i suppose one way to do it could be to provide a FunctionK[F, Future]and build a ToResponseMarshaller from/with that
Jens Grassel
@jan0sch
Meaning I must provide implementations for all needed types (for example, Future, Task, IO)?
Olli Helenius
@liff
well at least for whatever F you are using in there
Jens Grassel
@jan0sch
Okay, thanks.
Nishant Kelkar
@kelkarn
Hello
I wanted to know how I can serialize a collection of my case class within a post entity of my akka-http server.
I want it to take in a post request with a body, and convert the body into my case class model.
I tried using RootJsonFormat but I keep getting: The request content was malformed:
In my Postman2 app.
Nishant Kelkar
@kelkarn
Ugh, this is quite frustrating.
Andriy Plokhotnyuk
@plokhotnyuk
@kelkarn have you tried integration with jsoniter-scala? in most cases just need to call make macro and a codec for whole nested structure of collections and case classes will be generated: https://github.com/plokhotnyuk/jsoniter-scala/blob/master/jsoniter-scala-benchmark/src/main/scala/com/github/plokhotnyuk/jsoniter_scala/macros/JsoniterCodecs.scala#L63
Nishant Kelkar
@kelkarn
I just decided to go with Circe
FastFailCirceSupport
Piotr Kosecki
@piotrkosecki
hi! I'm trying to write some error handling for my routes with jackson deserialization, but it looks like my error handler is not used because I get java.lang.NullPointerException instead of any other viable unmarshalling error
has anyone encountered problem like this?
Borey
@skborey_twitter
Hi! Could i ask question relate spray json here?
Alexander Semenov
@Tvaroh
@hseeberger no 2.11 artifact for 1.23.0?
Andriy Plokhotnyuk
@plokhotnyuk
@Tvaroh which JSON library do you need to integrate with Akka-HTTP? most changes between v1.22.0 and v1.23.0 were in versions of JSON libraries: https://github.com/hseeberger/akka-http-json/compare/v1.22.0...v1.23.0
Alexander Semenov
@Tvaroh
Circe
Andriy Plokhotnyuk
@plokhotnyuk
It should not be a problem to use v1.22.0 with the latest version of circe... but beware about an unresolved security issue in it: circe/circe#1040
Andriy Plokhotnyuk
@plokhotnyuk
@Tvaroh I have opened an issue on behalf of you for that case hseeberger/akka-http-json#236
Alexander Semenov
@Tvaroh
Thanks @plokhotnyuk
Jakub Kozłowski
@kubukoz
@hseeberger can you please make a release of 1.23.0 for 2.11? Thanks
Ryan Tomczik
@Tomczik76
Hey everyone
@hseeberger I'm seeing an issue of when I use json4s I complete(Ok, None) has no body
while with cirice the body is null
Jakub Kozłowski
@kubukoz
Is it maybe that circe serializes none to null by default, and json4s skips that field altogether? Shouldn't be the fault of this library, more like configuring the appropriate json lib you're using
chet
@chetkhatri
Hi Everyone, I am working with Rest API first time with Scala. What I am trying to do is GET https://api.openaq.org/v1/cities push to KafkaProducer in a topic with results element in JSON response. Can anyone please help me. Appreciated, Thanks.
Milan van der Meer
@milanvdm

Hi all, Im trying to use

parameter(
          'consumer_id.as[Consumer.Id]
        )

with akka-http-circe support.
Im importing FailFastCirceSupport and have circe decoder on my case class.
For some reason it is not picking up an Unmarshaller for Consumer.Id based on the circe decoder.
This code works if I create a custom Unmarshaller for Consumer.Id but that kinda kills the purpose of akka-http-circe.

Sean Kwak
@cosmir17

Hi, this is about using snake case (json4s). I have the following example.
json4s/json4s@ffc4c9c

How can I use this snake case example in the following code?
https://github.com/hseeberger/akka-http-json/blob/master/akka-http-json4s/src/test/scala/de/heikoseeberger/akkahttpjson4s/ExampleApp.scala

It's magic what's happening between Formats and as[Foo].

Thank you,
Sean

objektwerks
@objektwerks
@hseeberger Using upickle and akka-http-pickle support, I can't get past ToResponseMarshallable errors, even when the IDE can easily see the correct types defined by standard the upickle protocol in my akka-http routes. Is there a working akka-http-upickle prototype project out there? I'm trying to transition for circe to upickle. Thanks in advance for any ideas!
objektwerks
@objektwerks
@hseeberger Heiko, I figured it out. A classic import issue.:) FYI for anyone else ( https://github.com/objektwerks/akka.http ). Of course, it could've been the beer.;)
Oron Sharabi
@oronsh
Hello I am new to scala and akka and I know this question maybe irrelevant to this place but how can I use the as Directive please? for unmarshalling
Andriy Plokhotnyuk
@plokhotnyuk
@oronsh Hi, Oron! Each sub-project has an example app which use as, like here.
Oron Sharabi
@oronsh
Thanks a lot @plokhotnyuk !
Philipp Dörfler
@phdoerfler
How do I enable error reporting? I created a trait trait AkkaHttpCirceSupport extends BaseCirceSupport with ErrorAccumulatingUnmarshaller and mixed it into my trait that does the Unmarshalling. Is this correct?

Previously I would get DecodingFailure(String, List()) which is not all that helpful, and now I get an exception:

de.heikoseeberger.akkahttpcirce.ErrorAccumulatingCirceSupport$DecodingFailures: DecodingFailure at : String
        at de.heikoseeberger.akkahttpcirce.ErrorAccumulatingUnmarshaller.$anonfun$unmarshaller$7(CirceSupport.scala:271)
        at cats.data.Validated.fold(Validated.scala:14)
        at de.heikoseeberger.akkahttpcirce.ErrorAccumulatingUnmarshaller.$anonfun$unmarshaller$6(CirceSupport.scala:271)
        at akka.http.scaladsl.util.FastFuture$.$anonfun$map$1(FastFuture.scala:23)
        at akka.http.scaladsl.util.FastFuture$.strictTransform$1(FastFuture.scala:41)
        at akka.http.scaladsl.util.FastFuture$.$anonfun$transformWith$3(FastFuture.scala:51)

which is also not that helpful. I am Unmarshalling a json response to a String. How could this ever fail?

Philipp Dörfler
@phdoerfler
fwiw Unmarshalling to io.circe.JsonObject works without a hitch. I can only assume that a content type must have been set that indicates to akka-http that there is json which in turn feeds it to circe via akka-http-json. And circe gets this json object which is clearly not a json string(, but a json object).
objektwerks
@objektwerks
FYI: "de.heikoseeberger" %% "akka-http-upickle" % "1.31.0" is causing Akka-Http code in Intellij to go massively red. Dropping back to version 1.30.0 removes all of the Intellij red errors. I'm using all of the latest versions of Akka, Akka-Http, UPickle and Scalatest. Outside of Intellij, though, version 1.3.1 works just fine, i.e., via bloop, metals and sbt. Not sure what's going on with Intellij and 1.31.0.