Language
Scala
Guardrail ships a modular Scala core with sbt and Maven integration. The same core runs as a CLI. Modules include guardrail-scala-support, guardrail-scala-akka-http, guardrail-scala-http4s, and guardrail-scala-dropwizard.
Example sbt configuration
In project/guardrail.sbt:
addSbtPlugin("dev.guardrail" % "sbt-guardrail" % "<version>")
libraryDependencies += "dev.guardrail" %% "guardrail-scala-http4s" % "<version>"In build.sbt:
Compile / guardrailTasks := List(
ScalaClient(file("github.yaml"), pkg = "com.example.clients.github", framework = "http4s"),
)Scala < 2.13 needs -Ypartial-unification. Scala < 2.12 additionally needs -Xexperimental.
Frameworks
- Akka HTTP
- http4s
- Dropwizard
Sample repositories
Pick library versions from the compatibility matrix. More plugin options live on the plugins page.