skillfed

flask-apispec

Build and document REST APIs with Flask and apispec

flask-apispec v0.11.4 356.0K downloads/30d#7,286 on PyPI653
Permissive license MIT AGING released

What it is and what it does

flask-apispec is a lightweight decorator-based library that bridges Flask, webargs, marshmallow, and apispec to streamline REST API development. It lets you annotate view functions and class-based views with decorators that simultaneously handle request parsing, response serialization, and automatic Swagger documentation generation. Instead of writing separate validation and documentation code, you declare your schema once and flask-apispec handles the rest.

The package works with vanilla Flask or Flask-RESTful, supporting both function-based and class-based views. It automatically serves Swagger JSON and Swagger-UI at configurable endpoints. However, the project is aging—last released in August 2022 with no active development since—so it may not track the latest versions of its dependencies or modern OpenAPI standards.

Use it for:

  • Build a REST API where request validation, response formatting, and Swagger docs are all declared via decorators on a single view.
  • Generate live Swagger documentation automatically from your Flask route handlers without writing separate spec files.
  • Migrate from Flask-RESTful or Flask-RESTplus to a lighter-weight approach that still provides structured request/response handling.
  • Combine webargs request parsing with marshmallow serialization in a single decorator stack on class-based views.
  • Serve Swagger-UI alongside your API to provide interactive documentation to API consumers.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

flask-apispec decorates Flask view functions and classes to automatically parse requests with webargs, format responses with marshmallow, and generate Swagger documentation via apispec.

Yes, if you are starting a new Flask REST API and want lightweight decorator-based request/response handling plus automatic Swagger generation. No, if you need active maintenance, support for the latest OpenAPI/Swagger standards, or compatibility with recent versions of its dependencies—the aging status and lack of updates since 2022 mean you may encounter compatibility issues or missing features. Consider it a stable but unmaintained choice for greenfield projects with stable dependency versions.

Install

flask-apispec on PyPI

pip

pip install flask-apispec

uv

uv add flask-apispec

poetry

poetry add flask-apispec

Installing flask-apispec

Before you install

Low install friction; depends on four well-established packages (flask, marshmallow, webargs, apispec). Maintenance is aging—last release was 2022-08-11 and no commits since 2025-05-04—so expect no active bug fixes or feature development, though the repo remains unarchived.

License in practice

MIT license is permissive; you can use, modify, and distribute flask-apispec with minimal restrictions, provided you include the license notice.

Quickstart

pip install flask-apispec

from flask import Flask
from flask_apispec import use_kwargs, marshal_with
from marshmallow import Schema
from webargs import fields

app = Flask(__name__)

class PetSchema(Schema):
    class Meta:
        fields = ('name', 'category')

@app.route('/pets')
@use_kwargs({'category': fields.Str()})
@marshal_with(PetSchema(many=True))
def get_pets(**kwargs):
    return []

Requires Python 3.6 or later; webargs, marshmallow, and apispec must be installed and compatible.

Verify before relying

  • Whether the package remains compatible with current versions of Flask, webargs, marshmallow, and apispec given the aging maintenance status.
  • Whether Swagger/OpenAPI generation still produces valid specs for modern API documentation tools.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.6)
Install friction low — pure-Python wheel
Runtime dependencies 4 — flask, marshmallow, webargs, apispec
Maintenance aging — 1,464 days since the last release
Last repo commit
First released
Downloads 356,015/month — #7,286 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: flask_apispec-0.11.4-py2.py3-none-any.whl

Keywords: flask, marshmallow, webargs, apispec

Tags

flask rest api swagger documentationflask request parsing response formattingflask apispec decoratorsswagger generation flaskflask marshmallow webargs integrationflask rest api documentationopenapi swagger flask
rest-apiswagger-openapirequest-validation

More Application Frameworks packages