Registry / web-framework / aiohttp-swagger3

aiohttp-swagger3

JSON →
library0.10.0pypypi✓ verified 84d ago

OpenAPI 3.x validation and Swagger UI for aiohttp web apps. Automatically validates requests and responses, generates OpenAPI docs, and serves Swagger UI, Redoc, and RapiDoc. Current release 0.10.1 (released 2025-02-15). Active development with monthly or quarterly releases.

pip install aiohttp-swagger3
INSTALL
IMPORT
SIG · AIOHTTP-SWAGGER3
A
aiohttp-swagger3
web-frameworkpythonv0.10.0
Install
4.2s avg
Import
876ms
Disk
34MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.10.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.912s · 34.1MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 4.2s · import 0.840s · 37MB
34MB installed
● package 34MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SwaggerDocs
from aiohttp_swagger3 import SwaggerDocs
Main class to set up Swagger documentation
swagger_doc
from aiohttp_swagger3 import swagger_doc
from aiohttp_swagger3 import swagger_docs
Decorator for adding YAML docs; note singular 'doc' not plural

Minimal setup with aiohttp application and SwaggerDocs.

from aiohttp import web from aiohttp_swagger3 import SwaggerDocs app = web.Application() swagger = SwaggerDocs(app, swagger_url="/api/doc", title="My API") async def hello(request): return web.json_response({"hello": "world"}) swagger.add_get("/hello", hello, summary="Hello endpoint") web.run_app(app)
Debug
Known issues
breakingPython 3.8 dropped in v0.10.0; requires Python >=3.9.
fix
Upgrade Python to 3.9+.
affects: >=0.10.0
breakingPython 3.7 dropped in v0.8.0.
fix
Upgrade Python to 3.8+ (or 3.9+ for >=0.10.0).
affects: >=0.8.0
breakingaiohttp version support changes: v0.9.0 adds aiohttp 3.10.x; v0.8.0 adds 3.9.x and drops 3.6.x and 3.7.x.
fix
Pin aiohttp to supported version range.
affects: >=0.8.0
gotchaaiohttp 3.6 and 3.7 are not supported after v0.8.0; use aiohttp >=3.8.
fix
Upgrade aiohttp to 3.8+.
affects: >=0.8.0
Errors
Common errors & fixes
AttributeError: module 'aiohttp_swagger3' has no attribute 'SwaggerDocs'
Using an outdated version or wrong import path.
fix
Ensure you have installed aiohttp-swagger3 (pip install aiohttp-swagger3) and use 'from aiohttp_swagger3 import SwaggerDocs'.
aiohttp_swagger3.exceptions.RequestValidationError
Request validation failed (e.g., missing required field, wrong type).
fix
Check your OpenAPI spec and request payload against the schema.
Upgrade
Version history
0.10.0latest on PyPI · released Feb 11, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
49 hits · last 30 days
node
42
OpenAI (training)
1
Resources
aiohttp-swagger3 — pip install aiohttp-swagger3 · libregistry