In transitioning from a monolith to microservices architecture, Zalando Tech has adopted “ API First” as one of our key engineering principles. API First ensures that our APIs are RESTful, robust, consistent, general, and abstracted from specific implementation and use cases. Swagger, a specification for descripting REST APIs in a language-agnostic manner, has become vitally important in our efforts to make API First a reality.

When our team tried to implement this principle for the first time, however, we faced some difficulty due to the lack of related Python frameworks. Several frameworks produce a Swagger definition from an implementation, but none that we found did the reverse. To fill the gap, my team and I recently developed Connexion: an open-source, REST framework for Python, built on top of Flask and based on Swagger, and targeted for microservice development.

Connexion automagically handles request routing, OAuth2 security, request parameter validation and response serialization based on a Swagger 2.0 Specification file in YAML. This eliminates the need to repeatedly write boilerplate code across our microservices. Because it is based on Flask, Connexion supports everything that Flask does, including deployment options and extensions. Visit our GitHub page to take a look.

In related: Go here to learn about the new Open API Initiative, which creates an open governance model around the Swagger Specification under the Linux Foundation!