iHeart/play-swagger is a Swagger spec generator for REST APIs built with Play Framework. It generates swagger specs from play route files and case class reflections without the need for any code annotation.
The main principles we follow when designing this library are:
- No code pollution (e.g. annotation)
- DRY (extract as much information from the code as possible)
- When documenting an endpoint, it should be just swagger specification that you need to write. You shall not need to learn another API or spec format.
Which translate to following features we implemented:
- Write your swagger specification in your routes files as comments (json or yml)
- Reference your case classes in your swagger spec and play-swagger will generate definitions
- Override anything in either the swagger spec in comment or the base swagger spec file.