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

Add UUID path extractor #1953

Merged
merged 2 commits into from Jul 18, 2018
Merged

Add UUID path extractor #1953

merged 2 commits into from Jul 18, 2018

Conversation

@tmfset
Copy link

@tmfset tmfset commented Jul 16, 2018

Add UUIDVar, a path extractor for java.util.UUID

I also considered adding a ValidatedUUIDVar to extract a Validated[Throwable, UUID] from paths but then realized that there is already a simple way to return BadRequest for invalid UUIDs:

HttpService[IO] match {
  case GET -> Root / "user" / UUIDVar(userId) => ...
  case GET -> Root / "user" / str => BadRequest(s"Invalid identifier '$str'")
}

The original PR targeted 0.18.x but broke binary compatibility, this new one targets master to avoid that complication.

Tom Fiset added 2 commits Jul 9, 2018
Tom Fiset
Tom Fiset
Copy link
Member

@rossabaker rossabaker left a comment

👍

Copy link
Member

@ChristopherDavenport ChristopherDavenport left a comment

👍 Going to have merge conflicts on the merge train with the backwards compatible stuff.

@ChristopherDavenport ChristopherDavenport merged commit ca11aec into http4s:master Jul 18, 2018
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.