flask-rebar

Flask-Rebar combines flask, marshmallow, and swagger for robust REST services.


Keywords
flask, rest, marshmallow, openapi, swagger, acsbp, public
License
MIT
Install
pip install flask-rebar==2.1.2

Documentation

Flask-Rebar

Documentation Status

CI Status

PyPI status

Code style

Code of Conduct

Flask-Rebar combines flask, marshmallow, and swagger for robust REST services.

Features

  • Request and Response Validation - Flask-Rebar relies on schemas from the popular Marshmallow package to validate incoming requests and marshal outgoing responses.
  • Automatic Swagger Generation - The same schemas used for validation and marshaling are used to automatically generate OpenAPI specifications (a.k.a. Swagger). This also means automatic documentation via Swagger UI.
  • Error Handling - Uncaught exceptions from Flask-Rebar are converted to appropriate HTTP errors.

Example

For a more complete example, check out the example app at examples/todo.py. Some example requests to this example app can be found at examples/todo_output.md.

Installation

pip install flask-rebar

Replacing static swagger-ui files

If you'd like to replace swagger-ui's static files (flask_rebar/swagger_ui/static) with those of the latest release, run the following from the root of the project.

curl -L https://api.github.com/repos/swagger-api/swagger-ui/tarball | tar -xv --directory=flask_rebar/swagger_ui/static --strip-components=2 "*/dist/"

Documentation

More extensive documentation can be found here.

Extensions

Flask-Rebar is extensible! Here are some open source extensions:

Contributing

There is still work to be done, and contributions are encouraged! Check out the contribution guide for more information.