Given the following routes
val route1: PathMatcher[Unit] = PathMatcher("app")
val route2: PathMatcher1[String] = PathMatchers.Segment
val route3: PathMatcher[Unit] = PathMatcher("lastSegment")
I can easily identify
val resultingRoute: PathMatcher[Tuple1[String]] = route1 / route2 / route3
getting the expected type (PathMatcher [Tuple [String]]).
But creating a route programmatically, as in
val routeDef = List(route1, route2, route3)
val resultingRoute = routeDef.reduce((a,b) => a / b)
won't compile giving me
could not find an implicit value for connecting parameters: akka.http.scaladsl.server.util.TupleOps.Join [_1, _1]
Also, the derived type resultRoute is
PathMatcher[_ >: Unit with Tuple1[String] with join.Out]
I would really appreciate any hint giving me some idea of ββwhat I'm doing wrong here or how this can be resolved.
For completeness, here is my import:
import akka.http.scaladsl.server.Directives._
import akka.http.scaladsl.server.{PathMatcher, _}
Many thanks!
source
share