connexion
Connexion - API first applications with OpenAPI/Swagger
What it is and what it does
Connexion is a Python web framework that inverts the typical API development workflow: you write an OpenAPI specification first, then Connexion automatically wires your Python functions to the routes, validates all requests and responses against the spec, and handles parameter unpacking and serialization. It works standalone via AsyncApp or FlaskApp, or as middleware wrapping any existing ASGI or WSGI application. The framework guarantees your API behaves exactly as specified—no manual route decorators, no hand-written validation logic, no documentation drift.
The core appeal is spec-first development: your OpenAPI file becomes the single source of truth for API behavior, shared with clients and teams before implementation begins. Connexion handles the plumbing (request validation, response serialization, authentication separation, Swagger UI console) so you focus on business logic. It depends on Starlette for async handling, Werkzeug for WSGI compatibility, PyYAML for spec parsing, jsonschema for validation, and several other standard libraries.
Use it for:
- Build a new REST API where the spec is written first and serves as the contract for frontend and backend teams.
- Add OpenAPI validation and documentation to an existing Flask or Starlette application via ConnexionMiddleware.
- Rapidly prototype and mock an API using connexion run openapi.yaml before writing handler code.
- Enforce strict request/response validation and automatic serialization to reduce bugs in parameter handling.
- Generate live Swagger UI documentation with 'try it out' capability directly from your specification.
- Migrate a Connexion 2.x application to the new Connexion 3 async-first architecture.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Connexion builds REST APIs from OpenAPI/Swagger specifications, automatically mapping routes, validating requests and responses, and handling parameter injection without decorators.
Yes. Connexion is actively maintained, has no known vulnerabilities, and offers a genuinely different development model—spec-first rather than code-first—that appeals to teams prioritizing API contracts and documentation. Low install friction and broad Python version support (3.9–3.14) make it accessible. Choose it if your workflow benefits from writing the spec first and letting the framework enforce it; avoid it if you prefer decorators and implicit routing.
Install
connexion on PyPI
pip
pip install connexionuv
uv add connexionpoetry
poetry add connexionInstalling connexion
Before you install
Low install friction with a pure-Python wheel. Active maintenance with recent commits; last release 305 days ago. Supports Python 3.9 through 3.14. Eleven runtime dependencies are all widely-used libraries (Starlette, Werkzeug, PyYAML, jsonschema, etc.), so environment resolution is straightforward.
License in practice
Apache-2.0 permissive license allows commercial use, modification, and redistribution with minimal restrictions—suitable for both open-source and proprietary projects.
Quickstart
pip install connexion
from connexion import AsyncApp
app = AsyncApp(__name__)
app.add_api('openapi.yaml')
# In openapi.yaml, link operationId to your Python function
# Connexion automatically unpacks parameters and serializes responses
Requires Python 3.9 or later. For development use of app.run(), install connexion[uvicorn]; for production, use an external ASGI server like uvicorn or gunicorn.
Verify before relying
- Performance characteristics and throughput under load compared to other ASGI frameworks.
- Maturity and stability of Connexion 3 relative to the 2.x line it recently replaced.
- Real-world adoption and community size beyond GitHub stars.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (<4.0,>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 11 — Jinja2, PyYAML, asgiref, httpx, inflection, jsonschema, python-multipart, requests, starlette, typing-extensions, werkzeug |
| Maintenance | actively maintained — 305 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 10,584,452/month — #1,444 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: connexion-3.3.0-py3-none-any.whl
Keywords: api, swagger, openapi
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
flask-openapi3Builds REST APIs on Flask with automatic…
permissive · top 15,000 on PyPI
flask-restplusFlask-RESTPlus adds decorators and tools to…
permissive · top 15,000 on PyPI
aiohttp-swagger3Integrates OpenAPI 3 documentation and request…
permissive · top 15,000 on PyPI
drf-yasgGenerates Swagger/OpenAPI 2.0 specifications…
permissive · top 5,000 on PyPI
flask-openapi3-swaggerProvides Swagger UI integration for…
permissive · top 15,000 on PyPI
bravadoBravado generates a dynamic REST client from an…
permissive · top 15,000 on PyPI
swagger-ui-pyIntegrates Swagger UI documentation into Python…
permissive · top 15,000 on PyPI
sphinxcontrib-openapiSphinx extension that renders OpenAPI (Swagger)…
permissive · top 15,000 on PyPI
flask-restxFlask-RESTX extends Flask with decorators and…
permissive · top 5,000 on PyPI
django-rest-swaggerGenerates Swagger UI documentation and OpenAPI…
permissive · top 15,000 on PyPI