aiopenapi3
client and validator for OpenAPI3 3.0, OpenAPI 3.1, OpenAPI 3.2, Swagger 2.0
What it is and what it does
aiopenapi3 is a Python client library that reads OpenAPI 3 and Swagger 2.0 specification documents, validates them using pydantic, and generates typed request and response models. It then provides both synchronous and asynchronous HTTP clients (via httpx) to call the described APIs with full type checking and validation. The library handles recursive schemas, format coercion (e.g., datetime parsing), and response header parsing.
You use it by loading a spec from a URL or file, then calling endpoints by operation ID with parameters that are automatically validated against the schema. The library supports both blocking and asyncio-based async calls, includes a plugin interface for adapting non-compliant services, and can download dependent specification documents. It's currently in Alpha status but actively maintained, with no known security vulnerabilities.
Use it for:
- Generate a type-safe Python client from a published OpenAPI spec without hand-writing request/response classes.
- Validate incoming API requests and responses against an OpenAPI schema in a test suite or integration layer.
- Build async microservice clients that automatically parse and coerce response bodies according to the spec.
- Adapt third-party APIs with non-standard OpenAPI documents using the plugin interface.
- Consume Swagger 2.0 or OpenAPI 3.x specs in a single codebase with automatic format handling.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Parses and validates OpenAPI 3 specifications (3.0.3, 3.1.0, 3.2.0) and Swagger 2.0 documents, then generates typed request/response models and provides both sync and async HTTP clients to call the described APIs.
Yes, if you need to work with OpenAPI or Swagger specs in Python. Low install friction, active maintenance, no vulnerabilities, and permissive licensing make it a safe choice. The Alpha status is worth noting—it's suitable for production use but may see API changes; check the docs for stability guarantees. The 10 runtime dependencies are well-established (pydantic, httpx, PyYAML, etc.), so dependency risk is low.
Install
aiopenapi3 on PyPI
pip
pip install aiopenapi3uv
uv add aiopenapi3poetry
poetry add aiopenapi3Installing aiopenapi3
Before you install
Low friction: pure Python wheel with no compiled dependencies. Active maintenance (last commit 2026-08-11) and no known vulnerabilities. Requires Python 3.10 or later.
License in practice
BSD-3-Clause (permissive): you may use, modify, and distribute this package freely in commercial and private projects, provided you retain the license notice.
Quickstart
pip install aiopenapi3
import aiopenapi3
# Load and validate an OpenAPI spec
spec = aiopenapi3.OpenAPI.load_sync('https://example.com/openapi.json')
# Call an endpoint with typed validation
response = spec.call_sync('operationId', param=value)
Requires Python 3.10 or later; async usage requires an asyncio event loop.
Verify before relying
- Whether the 'sad smiley ._. interface' for method/argument access is stable or experimental.
- Performance characteristics when validating large or deeply nested OpenAPI documents.
- Support for OpenAPI extensions and vendor-specific fields beyond the core spec.
Package facts
| License | BSD-3-Clause (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 10 — PyYaml, pydantic, email-validator, yarl, httpx, more-itertools, typing_extensions, jmespath, ijson, jsonseq |
| Maintenance | actively maintained — 105 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 333,861/month — #7,497 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: aiopenapi3-0.10.0-py3-none-any.whl
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
openapi3Parses and validates OpenAPI 3 specifications,…
permissive · top 15,000 on PyPI
openapi-spec-validatorValidates OpenAPI specifications (versions 2.0,…
permissive · top 1,000 on PyPI
openapi-coreValidates and unmarshals OpenAPI v3.0, v3.1,…
permissive · top 5,000 on PyPI
flask-openapi3Builds REST APIs on Flask with automatic…
permissive · top 15,000 on PyPI
openapi-schema-pydanticProvides Pydantic classes that map to the…
permissive · top 5,000 on PyPI
apispecGenerates OpenAPI specification documents from…
permissive · top 5,000 on PyPI
prancePrance parses and validates Swagger/OpenAPI 2.0…
unclear · top 5,000 on PyPI
swagger-spec-validatorValidates Swagger/OpenAPI specifications…
permissive · top 15,000 on PyPI
openapi-schema-validatorValidates data and schemas against OpenAPI…
permissive · top 1,000 on PyPI
flask-pydantic-specAdds OpenAPI documentation generation and…
unclear · top 15,000 on PyPI