aboutsummaryrefslogtreecommitdiff
path: root/core-rest/src/main/scala/xyz/driver/core/rest/directives/PathMatchers.scala
diff options
context:
space:
mode:
Diffstat (limited to 'core-rest/src/main/scala/xyz/driver/core/rest/directives/PathMatchers.scala')
-rw-r--r--core-rest/src/main/scala/xyz/driver/core/rest/directives/PathMatchers.scala6
1 files changed, 6 insertions, 0 deletions
diff --git a/core-rest/src/main/scala/xyz/driver/core/rest/directives/PathMatchers.scala b/core-rest/src/main/scala/xyz/driver/core/rest/directives/PathMatchers.scala
index 218c9ae..0d60893 100644
--- a/core-rest/src/main/scala/xyz/driver/core/rest/directives/PathMatchers.scala
+++ b/core-rest/src/main/scala/xyz/driver/core/rest/directives/PathMatchers.scala
@@ -28,6 +28,12 @@ trait PathMatchers {
}
}
+ def UuidIdInPath[T]: PathMatcher1[UuidId[T]] =
+ AkkaPathMatchers.JavaUUID.map((id: UUID) => UuidId[T](id))
+
+ def NumericIdInPath[T]: PathMatcher1[NumericId[T]] =
+ AkkaPathMatchers.LongNumber.map((id: Long) => NumericId[T](id))
+
def NameInPath[T]: PathMatcher1[Name[T]] = new PathMatcher1[Name[T]] {
def apply(path: Path) = path match {
case Path.Segment(segment, tail) => Matched(tail, Tuple1(Name[T](segment)))