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.