Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 09:07
    codecov[bot] commented #934
  • 09:07
    ptrdom synchronize #934
  • Nov 27 19:59
    julienrf synchronize #963
  • Nov 27 19:38
    julienrf commented #963
  • Nov 27 19:38
    julienrf synchronize #963
  • Nov 27 19:23
    ptrdom commented #963
  • Nov 27 19:08
    julienrf synchronize #963
  • Nov 27 14:21
    julienrf commented #963
  • Nov 27 13:58
    ptrdom commented #963
  • Nov 27 13:39
    julienrf synchronize #963
  • Nov 27 13:36
    julienrf commented #948
  • Nov 27 13:04
    julienrf commented #963
  • Nov 27 12:56
    julienrf commented #963
  • Nov 26 21:23
    ptrdom commented #963
  • Nov 26 21:11
    codecov[bot] commented #934
  • Nov 26 20:59
    codecov[bot] commented #934
  • Nov 26 20:30
    codecov[bot] commented #934
  • Nov 26 20:30
    ptrdom synchronize #934
  • Nov 26 19:18

    julienrf on master

    Fix http4s byte chunked entitie… (compare)

  • Nov 26 19:18
    julienrf closed #961
Julien Richard-Foy
@julienrf
You can add kindprojector, if needed.
Yes, cats-laws is probably the way to go. Here is how I use it in another project: https://github.com/julienrf/faithful/blob/master/faithful-cats/src/test/scala/faithful/cats/TestSuite.scala#L35
Dominic Egger
@GrafBlutwurst
I think 2.13.x added * but i don't know what the impact on crosscompiling to 2.12 is so i guess kind projector is the way to go.
Dominic Egger
@GrafBlutwurst
I think I'll need a couple pointer how to add this test in the current hierarchy of tests. I'm a bit lost as to their structure and how they're meant to work @julienrf
Julien Richard-Foy
@julienrf
Yeah, I’m really sorry the test architecture has grown organically and it’s not easy to navigate…
@GrafBlutwurst in your case, you can define a test in the http4s/server/src/test/scala/ directory
You don’t need to reuse anything from the other testsss
create a new file, with a server interpreter instance, then run the cats laws on it.
Julien Richard-Foy
@julienrf
I have published a new release of the http4s-server module with the two PRs recently merged: https://github.com/endpoints4s/endpoints4s/releases/tag/http4s-server-v3.0.0
(only this module has been published)
Dominic Egger
@GrafBlutwurst
@julienrf no worries! You mentioned that the tests aren't the easiest! thanks for the pointers
Dominic Egger
@GrafBlutwurst
@julienrf is it possible that the new release has transitive dependencies that are not published?
[warn]     :: org.endpoints4s#algebra_2.13;1.1.0+61-9ae3d443: not found
[warn]     :: org.endpoints4s#openapi_2.13;1.1.0+61-9ae3d443: not found
Julien Richard-Foy
@julienrf
oups, yes it is…
Dominic Egger
@GrafBlutwurst
scala stewards pipeline was yelling at me :p
Roland Reckel
@rreckel
Hi, I got a problem when using the http4s server interpreter on a http2 nginx proxy.
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