question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Replace `Http4sDsl.Path` with `Uri.Path`

See original GitHub issue

Follow-up from Gitter discussion:

We are recreating an Http4sDsl.Path from a Uri.Path every time we call -> in the DSL. This is inefficient and confusing.

We should be able to eliminate Http4sDsl.Path, replace Http4sDsl.Root with Uri.Path.Root, and replace Http4s.Dsl./ with an extractor in the spirit of the existing /:.

Incomplete, sloppy proof of concept: https://github.com/rossabaker/http4s/commit/57ff176221b0c695bc3f604b370cbbcaa0e97387

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
rossabakercommented, Nov 16, 2020

This work will have to target main. I don’t think there is any way to do it in a binary-compatible fashion.

1reaction
rossabakercommented, Nov 16, 2020

And I was mistaken on Gitter the other day when I said our -> extractor has nothing to do with HTTP: it operates specifically on a Request, and does belong in the HTTP library.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The http4s DSL
uri.path allows multiple services to be composed without rewriting all the path matchers. Matching paths. A request to the root of the service ......
Read more >
http4s/http4s - Gitter
This is the path in the DSL, not the path in the URI. Which is another questionable point, I think. scala> val p:...
Read more >
Routes with `"" /:` don't match in 0.20 · Issue #2273 - GitHub
_ import org.http4s.dsl.Http4sDsl import org.http4s.implicits. ... for a proposed change to make the behavior of "" /: path more consistent.
Read more >
http4s client create Uri from a string - scala - Stack Overflow
I cleaned them up a bit for you: libraryDependencies ++= Seq( "org.http4s" %% "http4s-core" % "0.15.3", "org.http4s" ...
Read more >
Unleashing the Power of HTTP Apis: The Http4s Library
So, we change the previous route definition in Request => F[Response] . ... Path : // From the Http4s DSL object -> {...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found