Skip to content
Web framework plugins for apispec (formally in apispec.ext).
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.



PyPI version Build status marshmallow 2/3 compatible code style: black

apispec plugins for integrating with various web frameworks.

These plugins used to be in apispec.ext but have since been moved to their own package.

Included plugins:

  • apispec_webframeworks.bottle
  • apispec_webframeworks.flask
  • apispec_webframeworks.tornado

Migration from apispec<1.0.0

To migrate from older versions of apispec, install this package with

pip install apispec-webframeworks

Change your imports, like so:

# apispec<1.0.0
from apispec.ext.flask import FlaskPlugin

# apispec>=1.0.0
from apispec_webframeworks.flask import FlaskPlugin

Example Usage

from flask import Flask
from apispec import APISpec
from apispec.ext.marshmallow import MarshmallowPlugin
from apispec_webframeworks.flask import FlaskPlugin
from marshmallow import Schema, fields

spec = APISpec(
    info=dict(description="A minimal gist API"),
    plugins=[FlaskPlugin(), MarshmallowPlugin()],

app = Flask(__name__)

class GistParameter(Schema):
    gist_id = fields.Int()

class GistSchema(Schema):
    id = fields.Int()
    content = fields.Str()

def gist_detail(gist_id):
    """Gist detail view.
                - in: path
                schema: GistParameter
                schema: GistSchema
    return "details about gist {}".format(gist_id)

# Since `path` inspects the view and its route,
# we need to be in a Flask request context
with app.test_request_context():


For documentation for a specific plugin, see its module docstring.


  • Clone and cd into this repo
  • Create and activate a virtual environment
  • Install this package (in editable mode) and the development dependencies
$ pip install '.[dev]'
  • Install pre-commit hooks
$ pre-commit install

Running tests

To run all tests:

$ pytest

To run syntax checks:

$ tox -e lint

(Optional) To run tests on Python 2.7, 3.5, 3.6, and 3.7 virtual environments (must have each interpreter installed):

$ tox


MIT licensed. See the bundled LICENSE file for more details.

You can’t perform that action at this time.