/acceptable

API version negotiation for flask-based web services.

Primary LanguagePythonGNU Lesser General Public License v3.0LGPL-3.0

Build Status Coverage Status

acceptable

Acceptable builds on top of flask and adds several opinionated features designed to make it easier to build a product from several small services.

Design Goals:

Acceptable is designed to solve several common problems when building a product composed of several individual services. Specifically, the library contains the following high-level features:

  • API endpoints are versioned using the Accept: HTTP header. Acceptable handles calling the correct view according to a simple version resolution protocol.

  • Views can be tagged with 'API flags', providing a way to test under-development views in a production environment. This opens the door to a more regular, predictable feature development velcoty.

  • View input and output is validated using jsonschema. This allows views to express their inputs and outputs in a concise manner.

    • These input and output definitions can be extracted from your various services and compiled into a library of service doubles, which facilitates easy inter-service interaction testing.