Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Dec 07 08:31
    ptrdom review_requested #972
  • Dec 06 15:15
    codecov[bot] commented #972
  • Dec 06 15:05
    ptrdom commented #972
  • Dec 06 15:03
    ptrdom opened #972
  • Dec 05 16:41
    ptrdom commented #953
  • Dec 05 16:36
    ptrdom commented #953
  • Dec 05 16:24
    julienrf commented #953
  • Dec 05 10:38
    ptrdom commented #953
  • Dec 05 09:34
    ptrdom commented #953
  • Dec 05 08:00
    julienrf commented #953
  • Dec 04 20:42
    ptrdom commented #953
  • Dec 04 18:36
    ptrdom commented #953
  • Dec 04 18:35
    ptrdom commented #953
  • Dec 04 18:21
    ptrdom commented #964
  • Dec 03 14:43
    julienrf closed #971
  • Dec 03 14:18
    codecov[bot] commented #971
  • Dec 03 14:06
    scala-steward opened #971
  • Dec 03 10:02

    julienrf on fix-ci-errors

    (compare)

  • Dec 03 10:02

    julienrf on master

    Remove unused import Fix version number (compare)

  • Dec 03 10:02
    julienrf closed #970
Roland Reckel
@rreckel
I declared the requestHeader("Authorization"), but I get an error "Missing header Authorization"
The problem is that http2 headers are all lower-case and get automatically transformed by Chrome/Safari etc to lowercase.
The problematic function is in Endpoints.scala at line 138: requestHeader()
I think it would be better to check the header existance using .lowerCase() on both sides, to avoid this.
What do you think? Should I open am issue and make a PR? Or is there an other solution?
Julien Richard-Foy
@julienrf
Hello, you are right, HTTP headers should be case insensitive. We should make sure that our interpreters are case insensitive.
It would be perfect if you could open an issue and make a PR
Roland Reckel
@rreckel
Thx for the reply. I will prepare a PR.
Luka Jacobowitz
@LukaJCB
Roland Reckel
@rreckel
http4s has already a Headers.get(s: CaseInsensitiveString).
I wanted to use that one... Is that alright?
Roland Reckel
@rreckel
Anyway, I just created a PR with the change. Feel free to comment/help and I will correct it of course.
Luka Jacobowitz
@LukaJCB
:+1:
Julien Richard-Foy
@julienrf
Great, thank you!
Dominic Egger
@GrafBlutwurst
I just noticed that I have a slight issue with cats laws for Monad[RequestEntity] this is a Functiontype and cats laws would like to have an Eq instance on it. How is this done on e.g. Reader I can't find the code for that
that should be able to get you going :)
Dominic Egger
@GrafBlutwurst
@LukaJCB thanks!
Dominic Egger
@GrafBlutwurst
wait isn't this essentially usage ofRepresentable? ugh I should have had that idea myelf
Dominic Egger
@GrafBlutwurst
@julienrf thanks for the publish. worked like a charm :ok_hand:
Dominic Egger
@GrafBlutwurst
I'm affraid I don't know when I get to finish the MonadError instace. I'm very sorry for the delay on that
Julien Richard-Foy
@julienrf
Do you need any help?
Luka Jacobowitz
@LukaJCB
I can help out as well
Dominic Egger
@GrafBlutwurst
it' really just finishing upthe tests, which tbh is the hard bit on this PR. if someone wants to pick it up sure. I'm just currently swamped at the job ( https://github.com/rivero-ag/endpoints4s/tree/feature-tc-instances)
Dominic Egger
@GrafBlutwurst
I'm right in the middle on figuring out how cats-laws and discipline works so don't take this code as something I would open a PR with :see_no_evil:
Dominic Egger
@GrafBlutwurst
@julienrf I was also wondering how to get traverse on Validated I just did my own instance of Applicative but the module where Validated lives has no cats dependency which makes sense. Should we consider a cats-extras module or perhaps a bespoke traverse implementation on Validated directly?
Julien Richard-Foy
@julienrf
What would be the signature of traverse on Validated?
I think we could create a cats-extras module, put the Applicative[Validated] instance into it, and make the http4s-server and http4s-client module depend on it.
Dominic Egger
@GrafBlutwurst
ah right we couldn't do traverse except we hardcode the other effect. so there'd be traverse overloaded over Option List etc. but that seems annoying
couldn't cats-extras also be it's own dependency a user may put into their buildfile?
Julien Richard-Foy
@julienrf
couldn't cats-extras also be it's own dependency a user may put into their buildfile?
sure
user753
@user753
Hi. How can I add description to each member of case class Foo(foo: String, bar: String) jsonResponse[Foo]?
Is it possible to add custom properties to OpenApi documentation like x-faker?
Julien Richard-Foy
@julienrf

@user753 We don’t support custom properties. You can add a documentation with the docs parameter of the field constructor:

field[String]("foo", docs = Some("A string…"))

In case you use generic derivation, you can use the @docs annotation:

case class Foo(@docs("A string…") foo: String, bar: String)
5 replies
Ryan Peters
@sloshy
Hello, I recently updated to the latest versions of endpoints & the circe/http4s support, and it seems that none of my endpoints are outputting JSON. Their error codes are correct, as are headers, but my browser and REST clients both are not returning any bodies. In fact Postman is giving me a parse error:
Error: Parse Error: Expected HTTP/
I'm using WSL2 on Windows but I can see that is not likely the problem as I was able to start an http4s quickstart g8 project and it seems to be working as expected
I feel like I must have misconfigured something since it does not seem anyone else has ran into this yet
Ryan Peters
@sloshy
Ahh I've reduced the problem to me using Ember as the server backend (vs the usual Blaze). I'll look into this w/ the http4s folks and see if maybe there's a known breakage
Luka Jacobowitz
@LukaJCB
I wonder if there should be a implicit def optionJsonSchema[A](jsonSchema: JsonSchema[A]): JsonSchema[Option[A]] in endpoints4s.algebra.JsonSchemas?
Julien Richard-Foy
@julienrf
Why not, how would you model None values in JSON?
Julien Richard-Foy
@julienrf
We need to make sure it wouldn’t clash with the existing optField constructor
Luka Jacobowitz
@LukaJCB
I would expect it to be mapped to null?
Julien Richard-Foy
@julienrf
This is not a good idea because this would not be parametric
Problems start to appear when you consider Option[Option[A]]
If you serialize Some(None) to null, you may deserialize it to None
Also, we currently treat null in object properties as a possible value for an optional field (it is decoded as None)
So, we need to be careful about how else we would use null
Luka Jacobowitz
@LukaJCB
Hmm
I guess that makes sense