Closed tindzk closed 5 years ago
Previously, static path elements were encoded in Route's HList. This prevented conditional routes such as the following:
Route
HList
if (isProduction) Root / "api" / "v2.0" else Root
Change the implementation such that only placeholders (e.g. Arg[String] or Fragment[Int]) are encoded in Route's type parameter.
Arg[String]
Fragment[Int]
Also, simplify the design by using tuples instead of HLists. As a consequence, the compile-time and run-time footprint is reduced.
Detailed changes:
#
$
ParamOpt[T]
Param[Option[T]]
None
Option.empty[T]
Codec
Closes #14. Closes #28.
Previously, static path elements were encoded in
Route
'sHList
. This prevented conditional routes such as the following:Change the implementation such that only placeholders (e.g.
Arg[String]
orFragment[Int]
) are encoded inRoute
's type parameter.Also, simplify the design by using tuples instead of
HList
s. As a consequence, the compile-time and run-time footprint is reduced.Detailed changes:
HList
sRoute
's type parameter#
to$
ParamOpt[T]
in favour ofParam[Option[T]]
None
instead ofOption.empty[T]
Codec
s can read/emit optional argumentsCloses #14. Closes #28.