sauldhernandez / sbt-swagger-spraygen   1.1.2

MIT License GitHub

SBT Plugin for code generation for Spray

Scala versions: 2.10
sbt plugins: 0.13

Swagger code generation for Spray

Build Status


This plugins helps you develop swagger-defined REST services with Spray.

Currently, the plugin only reads the definitions section from the swagger YAML file, and generates case classes and implicit jsonFormats for them.


The plugins was designed to take a file that complies with the Swagger 2.0 spec. If jsonFormat generation is enabled, the generated formats can be used with spray-json 1.3 and up.


  • Add the plugin in your plugins.sbt:
addSbtPlugin("com.sauldhernandez" % "sbt-swagger-spraygen" % "1.1.2")
  • This plugin is an AutoPlugin, so you must add it to your project in build.sbt:
lazy val root = (project in file(".")).enablePlugins(SpraySwaggerGenPlugin)
  • Add the plugin to your sourceGenerators:
sourceGenerators in Compile <+= spraygen in Compile
  • Modify the plugin settings to fit your needs.