Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes #2000, #2001 #2005

Merged
merged 2 commits into from
Feb 21, 2023
Merged

fixes #2000, #2001 #2005

merged 2 commits into from
Feb 21, 2023

Conversation

jdegoes
Copy link
Member

@jdegoes jdegoes commented Feb 21, 2023

No description provided.

@codecov-commenter
Copy link

Codecov Report

Base: 62.23% // Head: 62.59% // Increases project coverage by +0.35% 🎉

Coverage data is based on head (4ee8e60) compared to base (9c0a439).
Patch coverage: 84.61% of modified lines in pull request are covered.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2005      +/-   ##
==========================================
+ Coverage   62.23%   62.59%   +0.35%     
==========================================
  Files         196      204       +8     
  Lines        5850     6047     +197     
  Branches      220      232      +12     
==========================================
+ Hits         3641     3785     +144     
- Misses       2209     2262      +53     
Impacted Files Coverage Δ
...o-http/src/main/scala/zio/http/netty/package.scala 100.00% <ø> (ø)
...scala/zio/http/endpoint/internal/RoutingTree.scala 79.71% <79.71%> (ø)
...scala/zio/http/codec/internal/AtomizedCodecs.scala 87.87% <100.00%> (+3.87%) ⬆️
...scala/zio/http/codec/internal/EncoderDecoder.scala 82.03% <100.00%> (+0.14%) ⬆️
...tp/src/main/scala/zio/http/endpoint/Endpoint.scala 36.92% <100.00%> (+10.76%) ⬆️
...n/scala/zio/http/endpoint/EndpointMiddleware.scala 63.15% <100.00%> (ø)
...http/src/main/scala/zio/http/endpoint/Routes.scala 88.88% <100.00%> (ø)
...ain/scala/zio/http/endpoint/RoutesMiddleware.scala 92.30% <100.00%> (ø)
...la/zio/http/endpoint/internal/EndpointServer.scala 100.00% <100.00%> (ø)
zio-http/src/main/scala/zio/http/Body.scala 77.04% <0.00%> (-8.14%) ⬇️
... and 11 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

val requestHandlers = Memoized[Routes.Single[R, _ <: E, _, _, M], EndpointServer[R, _ <: E, _, _, M]] {
handledApi =>
EndpointServer(handledApi)
}

Http
.collectZIO[Request] { case (request: Request) =>
val handler = handlerTree.lookup(request)
.collectZIO[Request] {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could use fromOptionalHandlerZIO and then no need to evaluate the lookup function twice

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, exactly what I was looking for!

@jdegoes jdegoes merged commit c2ba9e0 into zio:main Feb 21, 2023
@jdegoes jdegoes deleted the endpoint-codecs-2 branch February 21, 2023 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants