Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 06:21

    hseeberger on master

    Update jsoniter-scala-core and … (compare)

  • 06:21
    hseeberger closed #338
  • 06:14
    plokhotnyuk opened #338
  • Oct 09 06:41
    hseeberger closed #335
  • Oct 09 06:40

    hseeberger on master

    Update jackson-module-scala to … (compare)

  • Oct 09 06:40
    hseeberger closed #337
  • Oct 08 23:28
    scala-steward synchronize #335
  • Oct 08 23:28
    scala-steward opened #337
  • Oct 08 14:40

    hseeberger on master

    Update jackson-module-scala to … (compare)

  • Oct 08 14:40
    hseeberger closed #331
  • Oct 08 14:11
    scala-steward synchronize #331
  • Oct 08 05:12

    hseeberger on master

    Update circe-core, circe-generi… (compare)

  • Oct 08 05:12
    hseeberger closed #336
  • Oct 07 22:09
    scala-steward opened #336
  • Sep 30 18:12
    scala-steward opened #335
  • Sep 28 16:33
    scala-steward opened #334
  • Sep 25 19:28

    hseeberger on master

    Update upickle to 0.8.0 (#333) (compare)

  • Sep 25 19:28
    hseeberger closed #333
  • Sep 25 19:13
    scala-steward opened #333
  • Sep 24 14:42

    hseeberger on master

    Update sbt-ci-release to 1.4.31… (compare)

Heiko Seeberger
@hseeberger
Thanks @jan0sch !
ranuser99
@ranuser99
Using akka-http-circe 1.20.0-RC1, with io.circe.generic.auto._, cannot umarshall case classes that include other (nested) case classes. For example , entity(as[MyClass]) { ...} will throw: "could not find implicit val
ue for parameter um: akka.http.scaladsl.unmarshalling.FromRequestUnmarshaller". Is this a limitation of automatic derivation or is it fixable? Thanks!
ranuser99
@ranuser99
Disregard... I had an unsupported type in my nested case classes that needed a custom encoder/decoder. Thanks for the great project.
Heiko Seeberger
@hseeberger
Thanks 😊
Olli Helenius
@liff
should the HttpEntity here be created with mediaType instead of fixed to application/json?
Heiko Seeberger
@hseeberger
Think so. Issue please.
Matthew de Detrich
@mdedetrich
Question, is there any real difference in performance with akka-http-json vs akka-stream-json (i.e. https://github.com/knutwalker/akka-stream-json)
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
Lambda Developer
@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.;)