connexion 3.3.0


pip install connexion

  Latest version

Released: Oct 13, 2025

Project Links

Meta
Author: Robbe Sneyders
Maintainer: Robbe Sneyders
Requires Python: >=3.9,<4.0

Classifiers

Development Status
  • 5 - Production/Stable

Intended Audience
  • Developers

License
  • OSI Approved :: Apache Software License

Operating System
  • OS Independent

Programming Language
  • Python
  • Python :: 3
  • Python :: 3.9
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13
  • Python :: 3.14
  • Python :: 3 :: Only

Topic
  • Internet
  • Internet :: WWW/HTTP
  • Internet :: WWW/HTTP :: HTTP Servers
  • Software Development
  • Software Development :: Libraries
  • Software Development :: Libraries :: Python Modules

Typing
  • Typed

coveralls PyPI version PyPI License GitHub Workflow Status Coveralls Gurubase

Explore the docs ยป


Connexion is a modern Python web framework that makes spec-first and api-first development easy. You describe your API in an OpenAPI (or Swagger) specification with as much detail as you want and Connexion will guarantee that it works as you specified.

It works either standalone, or in combination with any ASGI or WSGI-compatible framework!


๐Ÿ“ข Connexion 3 was recently released! Read about the changes here ยป

โœจ Features

Connexion provides the following functionality based on your specification:

  • ๐Ÿš Automatic route registration, no @route decorators needed
  • ๐Ÿ”’ Authentication, split from your application logic
  • ๐Ÿ”Ž Request and response validation of headers, parameters, and body
  • ๐Ÿ“ฌ Parameter parsing and injection, no request object needed
  • ๐Ÿ“จ Response serialization, you can return regular Python objects
  • ๐Ÿ“บ A Swagger UI console with live documentation and โ€˜try it outโ€™ feature
  • ๐Ÿงฉ Pluggability, in all dimensions

Connexion also helps you write your OpenAPI specification and develop against it by providing a command line interface which lets you test and mock your specification.

   connexion run openapi.yaml

(back to top)

๐Ÿซถ Sponsors

Sponsors help us dedicate time to maintain Connexion. Want to help?

Explore the options ยป

(back to top)

๐Ÿชค Why Connexion

With Connexion, you write the spec first. Connexion then calls your Python code, handling the mapping from the specification to the code. This incentivizes you to write the specification so that all of your developers can understand what your API does, even before you write a single line of code.

If multiple teams depend on your APIs, you can use Connexion to easily send them the documentation of your API. This guarantees that your API will follow the specification that you wrote. This is a different process from the one offered by most frameworks, which generate a specification after you've written the code. Some disadvantages of generating specifications based on code is that they often end up lacking details or mix your documentation with the implementation logic of your application.

(back to top)

โš’๏ธ How to Use

Installation

You can install connexion using pip:

    $ pip install connexion

Connexion provides 'extras' with optional dependencies to unlock additional features:

  • swagger-ui: Enables a Swagger UI console for your application.
  • uvicorn: Enables to run the your application using app.run() for development instead of using an external ASGI server.
  • flask: Enables the FlaskApp to build applications compatible with the Flask ecosystem.

You can install them as follows:

    $ pip install connexion[swagger-ui]
    $ pip install connexion[swagger-ui,uvicorn]

(back to top)

Creating your application

Connexion can be used either as a standalone application or as a middleware wrapping an existing ASGI (or WSGI) application written using a different framework. The standalone application can be built using either the AsyncApp or FlaskApp.

  • The AsyncApp is a lightweight application with native asynchronous support. Use it if you are starting a new project and have no specific reason to use one of the other options.

        from connexion import AsyncApp
    
        app = AsyncApp(__name__)
    
  • The FlaskApp leverages the Flask framework, which is useful if you're migrating from connexion 2.X or you want to leverage the Flask ecosystem.

        from connexion import FlaskApp
    
        app = FlaskApp(__name__)
    
  • The ConnexionMiddleware can be wrapped around any existing ASGI or WSGI application. Use it if you already have an application written in a different framework and want to add functionality provided by connexion

        from asgi_framework import App
        from connexion import ConnexionMiddleware
    
        app = App(__name__)
        app = ConnexionMiddleware(app)
    

(back to top)

Registering an API

While you can register individual routes on your application, Connexion really shines when you register an API defined by an OpenAPI (or Swagger) specification. The operation described in your specification is automatically linked to your Python view function via the operationId

run.py

   def post_greeting(name: str, greeting: str):  # Paramaeters are automatically unpacked
       return f"{greeting} {name}", 200          # Responses are automatically serialized

   app.add_api("openapi.yaml")

openapi.yaml

   ...
   paths:
     /greeting/{name}:
       post:
         operationId: run.post_greeting
         responses:
           '200':
             content:
               text/plain:
                 schema:
                   type: string
         parameters:
           - name: name
             in: path
             required: true
             schema:
               type: string
           - name: greeting
             in: query
             required: true
             schema:
               type: string

(back to top)

Running your application

If you installed connexion using connexion[uvicorn], you can run it using the run method. This is only recommended for development:

    app.run()

In production, run your application using an ASGI server such as uvicorn. If you defined your app in a python module called run.py, you can run it as follows:

    $ uvicorn run:app

Or with gunicorn:

    $ gunicorn -k uvicorn.workers.UvicornWorker run:app

Now you're able to run and use Connexion!

See the examples folder for more examples.

(back to top)

๐Ÿ“œ Changes

A full changelog is maintained on the GitHub releases page.

(back to top)

๐Ÿคฒ Contributing

We welcome your ideas, issues, and pull requests. Just follow the usual/standard GitHub practices.

For easy development, install connexion using poetry with all extras, and install the pre-commit hooks to automatically run black formatting and static analysis checks.

    pip install poetry
    poetry install --all-extras
    pre-commit install

You can find out more about how Connexion works and where to apply your changes by having a look at our architecture.

Unless you explicitly state otherwise in advance, any non trivial contribution intentionally submitted for inclusion in this project by you to the steward of this repository shall be under the terms and conditions of Apache License 2.0 written below, without any additional copyright information, terms or conditions.

(back to top)

๐Ÿ™ Thanks

We'd like to thank all of Connexion's contributors for working on this project, Swagger/OpenAPI for their support, and Zalando for originally developing and releasing Connexion.

๐Ÿ“š Recommended Resources

About the advantages of working spec-first:

Tools to help you work spec-first:

3.3.0 Oct 13, 2025
3.2.0 Jan 08, 2025
3.1.0 May 27, 2024
3.0.6 Feb 14, 2024
3.0.5 Dec 07, 2023
3.0.4 Dec 06, 2023
3.0.3 Nov 30, 2023
3.0.2 Nov 20, 2023
3.0.1 Nov 06, 2023
3.0.0 Nov 02, 2023
3.0.0a8 Oct 30, 2023
3.0.0a7 Aug 29, 2023
3.0.0a6 Apr 24, 2023
3.0.0a5 Apr 22, 2023
3.0.0a4 Mar 30, 2023
3.0.0a3 Mar 28, 2023
3.0.0a2 Mar 06, 2023
3.0.0a1 Mar 03, 2023
2.15.1 Oct 13, 2025
2.15.1rc1 Oct 13, 2025
2.15.0 Oct 04, 2025
2.15.0rc3 Aug 06, 2025
2.15.0rc2 Jun 22, 2025
2.15.0rc1 Jun 09, 2025
2.14.2 Jan 25, 2023
2.14.1 Aug 23, 2022
2.14.0 Jun 22, 2022
2.13.1 Apr 27, 2022
2.13.0 Mar 22, 2022
2.12.0 Feb 23, 2022
2.11.2 Feb 18, 2022
2.11.1 Feb 09, 2022
2.11.0 Feb 08, 2022
2.10.0 Jan 15, 2022
2.9.0 Jul 16, 2021
2.8.0 Jul 08, 2021
2.7.0 Apr 25, 2020
2.6.0 Jan 29, 2020
2.5.1 Dec 19, 2019
2.5.0 Dec 16, 2019
2.4.0 Oct 18, 2019
2.3.0 Jun 14, 2019
2.2.0 Dec 24, 2018
2.1.0 Dec 11, 2018
2.0.2 Nov 15, 2018
2.0.1 Nov 07, 2018
2.0.0 Nov 05, 2018
2.0.0rc5 Oct 29, 2018
2.0.0rc4 Oct 29, 2018
2.0.0rc3 Oct 05, 2018
2.0.0rc2 Oct 04, 2018
2.0.0rc1 Oct 01, 2018
1.5.3 Sep 17, 2018
1.5.2 Jul 26, 2018
1.5.1 Jul 23, 2018
1.5.0 Jul 23, 2018
1.4.2 May 16, 2018
1.4.1 May 15, 2018
1.4 Apr 09, 2018
1.3 Jan 13, 2018
1.2 Nov 17, 2017
1.1.16 Oct 11, 2017
1.1.15 Sep 08, 2017
1.1.14 Aug 28, 2017
1.1.13 Jul 29, 2017
1.1.12 Jul 21, 2017
1.1.11 Jul 08, 2017
1.1.10 May 26, 2017
1.1.9 Apr 07, 2017
1.1.8 Apr 05, 2017
1.1.7 Apr 04, 2017
1.1.6 Apr 04, 2017
1.1.5 Feb 16, 2017
1.1.4 Jan 13, 2017
1.1.3 Jan 11, 2017
1.1.2 Jan 10, 2017
1.1.1 Jan 07, 2017
1.1 Jan 04, 2017
1.0.129 Oct 10, 2016
1.0.128 Oct 04, 2016
1.0.127 Oct 04, 2016
1.0.125 Sep 29, 2016
1.0.124 Sep 22, 2016
1.0.123 Sep 22, 2016
1.0.121 Sep 15, 2016
1.0.112 Sep 01, 2016
1.0.109 Aug 01, 2016
1.0.107 Jul 25, 2016
1.0.103 Jun 08, 2016
1.0.98 Jun 03, 2016
1.0.97 May 17, 2016
1.0.95 May 17, 2016
1.0.94 May 11, 2016
1.0.93 May 11, 2016
1.0.91 Apr 24, 2016
1.0.89 Apr 12, 2016
1.0.88 Apr 07, 2016
1.0.84 Mar 31, 2016
1.0.81 Mar 30, 2016
1.0.76 Mar 09, 2016
1.0.67 Mar 02, 2016
1.0.61 Feb 17, 2016
1.0.58 Feb 13, 2016
1.0.57 Feb 11, 2016
1.0.54 Feb 08, 2016
1.0.53 Feb 05, 2016
1.0.52 Feb 03, 2016
1.0.51 Feb 03, 2016
1.0.50 Feb 03, 2016
1.0.49 Feb 02, 2016
1.0.38 Jan 21, 2016
1.0.37 Jan 13, 2016
1.0.33 Jan 12, 2016
1.0.31 Jan 12, 2016
1.0.29 Jan 05, 2016
1.0.28 Dec 21, 2015
1.0.26 Dec 08, 2015
1.0.25 Dec 08, 2015
1.0.22 Dec 05, 2015
1.0.20 Dec 05, 2015
1.0.19 Dec 04, 2015
1.0.9 Nov 18, 2015
1.0.8 Nov 18, 2015
1.0.5 Nov 12, 2015
0.13 Nov 06, 2015
0.12.1 Oct 29, 2015
0.12.0 Oct 13, 2015
0.11.3 Oct 07, 2015
0.11.2 Oct 02, 2015
0.11.1 Sep 28, 2015
0.11 Sep 23, 2015
0.10.2 Sep 21, 2015
0.10.1 Sep 18, 2015
0.10 Sep 18, 2015
0.9.4 Sep 04, 2015
0.9.3 Sep 02, 2015
0.9.2 Aug 27, 2015
0.9.1 Aug 27, 2015
0.9.0 Aug 26, 2015
0.8.6 Aug 18, 2015
0.8.5 Aug 13, 2015
0.8.4 Aug 11, 2015
0.8.3 Aug 05, 2015
0.8.2 Aug 05, 2015
0.8.1 Jul 31, 2015
0.8 Jul 31, 2015
0.7.6 Jul 28, 2015
0.7.5 Jul 23, 2015
0.7.4 Jul 23, 2015
0.7.3 Jul 23, 2015
0.7.2 Jul 20, 2015
0.7.1 Jul 17, 2015
0.7.0 Jul 08, 2015
0.6.1 Jul 07, 2015
0.6.0 Jun 29, 2015
0.5.1 Jun 22, 2015
0.5.0 Jun 18, 2015
0.4.2 Jun 17, 2015
0.4.1 Jun 12, 2015
0.4 Jun 12, 2015
0.3.1 Jun 08, 2015
0.3 Jun 07, 2015
0.2 May 21, 2015
0.1 May 19, 2015

Wheel compatibility matrix

Platform Python 3
any

Files in release

Extras:
Dependencies:
Jinja2 (>=3.0.0)
PyYAML (>=5.1)
asgiref (>=3.4)
httpx (>=0.23)
inflection (>=0.3.1)
jsonschema (>=4.17.3)
python-multipart (>=0.0.15)
requests (>=2.27)
starlette (>=0.35)
typing-extensions (>=4.6.1)
werkzeug (>=2.2.1)