Building Swagger Phoenix

The Swagger Phoenix Build

This series of blog posts will follow my build of Swagger Phoenix in Elixir. The idea behind Swagger Phoenix is that you should be able to specify your API using a Swagger Spec and have the majority of the application generated for you.

This workflow provides a structured and orderly way to build an API, solves the problem of documentation being out of sync with your API and allows you to focus on writing the code that is truly unique to your problem.

The Use Case

Swagger Phoenix allow you to do this:
1. Add your swagger spec to your project.
2. Generate just the code that needs to be generated. The spec is processed and migrations and tests are scaffolded automatically. Controllers, Views and Models are created automatically at compile time. Customization can be done in static files that don't get overwritten when the spec changes.

Swagger Phoenix Main Features:

  • Meta-programmed Scaffolding - all the boiler plate will be meta-programmed using the Swagger Spec as a DSL.
  • Migrations - with migrations you can modify and evolve your swagger specification. Proper Ecto migration differentials will be generated to keep the database in sync.
  • Simple Extension Points - Customization outside of what is specified in the Swagger spec is available using generated extension modules.


The repository for this project is here: