Community-maintained Flask extension for building REST APIs with decorators, models, and automatic Swagger documentation. Forked from Flask-RESTPlus to continue releases.
Overview
Flask-RESTX is a Flask extension for quickly building REST APIs with a coherent set of decorators and helpers. It exposes API documentation through Swagger and is presented as a community-driven fork of Flask-RESTPlus, created because the original PyPI project could not ship new releases.
Developers define namespaces, resource classes, request and response models, and marshalling rules. Decorators document list, create, read, update, and delete operations and attach expected payloads and response codes. The quick-start pattern centers on an Api instance attached to a Flask app, with Resource subclasses handling HTTP methods.
Documentation covers resource routing, argument parsing, error handling, response marshalling, file uploads, blueprint integration, multiple APIs, and exporting OpenAPI specifications with Swagger UI. Python 3.10 or newer is required, with guidance on Flask and Werkzeug version pairings.
Installation is available through pip or easy_install. Guides cover migration from Flask-RESTPlus, model factories, custom fields, and authorization documentation for APIs.
Key features
- Swagger/OpenAPI documentation
- Namespace and Resource routing
- Request and response model factories
- Marshalling and parsing decorators
- Blueprint and multi-API support
- Error handler integration
- Swagger UI exposure
- Flask-RESTPlus migration guides
Use cases
- Documented REST APIs on Flask
- CRUD services with marshalled models
- Multi-namespace API projects
- Swagger-driven API exploration
- Teams migrating from Flask-RESTPlus