Scala implementation of URI Template (RFC 6570).
uritemplate4s is currently available for Scala 2.13, 2.12 and Scala.js.
Add the following to your build.sbt
:
libraryDependencies += "com.gubbns" %% "uritemplate4s" % "0.5.7"
import uritemplate4s._
val template = uritemplate"https://{host}/search{?q}{¶ms*}"
template.expand(
"host" -> "search-engine.com",
"q" -> "Esio Trot",
"params" -> Map("lang" -> "en", "type" -> "book")
).value
// res0: String = https://search-engine.com/search?q=Esio%20Trot&lang=en&type=book
Further documentation is available here.