twilio / sbt-guardrail

Principled code generation for Scala services

GitHub

sbt-guardrail

An SBT 1.x+ plugin for adding clients and servers generated by guardrail to your service.

Installation

project/plugins.sbt

addSbtPlugin("com.twilio" % "sbt-guardrail" % "0.37.1-M1")

build.sbt

/* Available arguments:
    specPath: java.io.File
    pkg: String
    dto: String
    framework: String
    tracing: Boolean
*/
guardrailTasks in Compile := List(
  Client(file("petstore.yaml")),
  Client(file("github.yaml"), pkg="com.example.clients.github"),
  Server(file("myserver.yaml"), pkg="com.example.server", tracing=true),
  Models(file("myserver.yaml"), pkg="com.example.models")
)