Skip to content


Upgrade to the latest version:

$ pip3 install -U apiflask
> pip install -U apiflask

or check the currently installed version first:

$ pip3 show apiflask
> pip show apiflask

Version 0.11.0

0.11.0 milestone

Version 0.10.1

Released: 2021/11/26

  • Fix missing headers for JSON error responses when catching Werkzeug exceptions (issue #173).

Version 0.10.0

Released: 2021/9/19

  • Support using add_url_rule method on view classes (issue #110).
  • Revoke the undocumented name changes on validates and validates_schema from marshmallow (issue #62).
  • Only expose marshmallow fields, validators, and Schema in APIFlask.
  • Remove the status_code field from the default error response (issue #124).
  • Add parameter extra_data to abort and HTTPError, it accepts a dict that will be added to the error response (issue #125).
  • Support passing operation_id in the doc decorator. The auo-generating of operationId can be enabled with config AUTO_OPERATION_ID, defaults to False (pull #131).
  • Support setting response links via @output(links=...) (issue #138).

Version 0.9.0

Released: 2021/8/10

  • Support base response schema customization, add config BASE_RESPONSE_SCHEMA and BASE_RESPONSE_DATA_KEY (issue #65).
  • Support setting custom schema name resolver via the APIFlask.schema_name_resolver attribute (issue #105).
  • Improve error handling (issue #107):
    • Authentication error now calls app error processor function when APIFlask(json_errors=True). The default HTTP reason phrase is used for auth errors.
    • Always pass an HTTPError instance to error processors. When you set a custom error processor, now you need to accept an HTTPError instance as the argument. The detail and headers attribute of the instance will be empty dict if not set.
    • Add an error_processor decorator for HTTPTokenAuth and HTTPBasicAuth, it can be used to register a custom error processor for auth errors.
  • Support to config Redoc via the configuration variable REDOC_CONFIG (issue #121).

Version 0.8.0

Released: 2021/7/7

  • Automatically add a 404 response in OpenAPI spec for routes contains URL variables (issue #78).
  • Rename the private method app.get_spec to app._get_spec, add new parameter force_update. The app.spec property now will always return the latest spec instead of the cached one (issue #79).
  • Support using doc(responses={<STATUS_CODE>: <DESCRIPTION>}) to overwrite existing response descriptions.
  • Add configration variable INFO (and attribute), it can be used to set the following info fields: description, termsOfService, contact, license (issue #98).
  • Rename the following configuration variables (issue #99):

Version 0.7.0

Released: 2021/6/24

  • Support using async error processor and async spec processor (pull #57).
  • Fix auto-tag support for nesting blueprint (pull #58).
  • Support set the URL prefix of the OpenAPI blueprint with the openapi_blueprint_url_prefix argument (pull #64).
  • Add a flask spec command to output the OpenAPI spec to stdout or a file, also add new config LOCAL_SPEC_PATH and LOCAL_SPEC_JSON_INDENT (issue #61).
  • Re-add the SPEC_FORMAT config. Remove the auto-detection of the format from APIFlask(spec_path=...), now you have to set the format explicitly with the SPEC_FORMAT config (issue #67).
  • Support to sync the local OpenAPI spec automatically. Add new config SYNC_LOCAL_SPEC (issue #68).
  • Change the default value of config DOCS_FAVICON to '', set to None to disable the favicon.
  • OpenAPI UI templates are move to
  • Revert the renames on pre/post decorators from marshmallow (issue #62).
  • Change the default branch to "main".
  • Move the source to the "src" directory.
  • Enable pre-commit.

Version 0.6.3

Released: 2021/5/17

  • Improve static request dispatch (pull #54).

Version 0.6.2

Released: 2021/5/16

  • Fix static request dispatch for Flask 2.0 (issue #52).

Version 0.6.1

Released: 2021/5/15

  • Fix type annotaion for Flask 2.0 (pull #48).
  • Fix type annotaion for schema parameter of input and output (pull #49).
  • Fix type annotaion for imports by exporting top-level name explicitly (pull #49).
  • Fix async for dispatch_request for Flask 2.0 (pull #50).

Version 0.6.0

Released: 2021/5/11

  • Support using the output decorator on async views (pull #41).
  • Add PaginationSchema and pagination_builder as basic pagination support (pull #42).
  • Import and rename the decorators from marshmallow (pull #43).
  • Rename utils module to helpers (pull #44).
  • Add default parameter for get_reason_phrase (pull #45).

Version 0.5.2

Released: 2021/4/29

  • Allow returning a Response object in a view function decorated with the output decorator. In this case, APIFlask will do nothing but return it directly (pull #38).
  • Skip Flask's Blueprint object when generating the OpenAPI spec (pull #37).

Version 0.5.1

Released: 2021/4/28

  • Change the default endpoint of the view class to the original class name (pull #36).
  • Allow passing the methods argument for the route decorator on view classes.

Version 0.5.0

Released: 2021/4/27

  • Remove the support to generate info.description and tag description from module docstring, and also remove the AUTO_DESCRIPTION config (pull #30).
  • Remove the configuration variable DOCS_HIDE_BLUEPRINTS, add APIBlueprint.enable_openapi as a replacement.
  • Support class-based views, now the route decorator can be used on MethodView class. Other decorators (i.e., @input, @output, etc.) can be used on view methods (i.e., get(), post(), etc.) (pull #32).
  • No longer support to mix the use of flask.Bluerpint and apiflask.APIBluerpint.
  • Support to use the auth_required decorator on app-wide before_request functions (pull #34).

Version 0.4.0

Released: 2021/4/20

  • Merge the following configuration variables to SUCCESS_DESCRIPTION (pull #7):
  • Remove the following configuration variables (pull #7):
  • Add new configuration variables YAML_SPEC_MIMETYPE and JSON_SPEC_MIMETYPE to support to customize the MIME type of spec response (pull #3).
  • Remove configuration variable SPEC_TYPE.
  • Fix the support to pass an empty dict as schema for 204 response (pull #12).
  • Support set multiple examples for request/response body with @output(examples=...) and @iniput(examples=...) (pull #23).
  • Add auth_required(roles=...) and doc(tags=...) parameters for list value, role and tag parameter now only accept string value (pull #26).
  • Add new configuration variable OPENAPI_VERSION to set the version of OAS (pull #27).
  • Rename abort_json() to abort() (pull #29).

Version 0.3.0

Released: 2021/3/31

  • First public version.
  • Add type annotations and enable type check in tox (commit).
  • Refactor the APIs (commit):
    • Change base class scaffold.Scaffold to class decorator utils.route_shortcuts.
    • Merge the _OpenAPIMixin class into APIFlask class.
    • Turn security._AuthErrorMixin into handle_auth_error function.
    • Add explicit parameter role and optional for @auth_required decorator.
    • Rename module errors to exceptions.
    • Rename api_abort() to abort_json().
    • Rename get_error_message() to get_reason_phrase() and move it to utils module.
    • Update the default value of config AUTH_ERROR_DESCRIPTION.
    • Add validators module.
    • Change @doc(tags) to @doc(tag).
  • Support to pass a dict schema in @output decorator (commit).
  • Support to pass a dict schema in @input decorator (commit).
  • Check if the status code is valid for abort_json and HTTPError (commit).
  • Add basic docstrings to generate the API reference documentation (commit).
  • Support to set custom example for request/response body (commit).

Version 0.2.0

Released: 2021-3-27

  • Fix various bugs.
  • Refactor the package and tests (100% coverage).
  • Rename most of the APIs.
  • Add new APIs:
    • APIFlask
    • APIBlueprint
    • HTTPError
    • api_json
    • HTTPTokenAuth
    • HTTPBasicAuth
    • @doc
    • EmptySchema
  • Add a bunch of new configuration variables:
    • TAGS
  • Support to hide blueprint from API docs with config DOCS_HIDE_BLUEPRINTS (commit)
  • Support to deprecate and hide an endpoint with doc(hide=True, deprecated=True)(commit)
  • Support to customize the API docs with various configuration variables. (commit)
  • Support to set all fields of OpenAPI object and Info object (commit)
  • Support YAML format spec (commit)
  • Automatically register a validation error response for endpoints which use @input. (commit)
  • Automatically register a authorization error response for endpoints which use @auth_required. (commit)
  • Automatically add response schema for responses added with @doc(responses=...). (commit)
  • Pass view arguments to view function as positional arguments (commit)
  • Require Python 3.7 to use ordered dict (commit)
  • Add shortcuts for app.route: app.get(),, etc. (commit)
  • Not an extension any more (commit)

Version 0.1.0

Released: 2021-1-27

  • Add view functions without response schema into spec (commit)
  • Set default response descriptions (commit)
  • Stop relying on Flask-Marshmallow (commit)
  • Change default spec path to openapi.json (commit)
  • Add support for enabling Swagger UI and Redoc at the same time (commit)
  • Change default spec title and version (commit)
  • Support auto generating summary from function name (commit)
  • Start as a fork of APIFairy 0.6.2 at 2021-01-13.