Releases: kappall/aiohttp_autodocs
Releases · kappall/aiohttp_autodocs
Release list
v0.1.8
v0.1.7 - Bug Fixes, Test Suite & Automated CI/CD
Highlights in this Release
Bug Fixes & Stability
StaticDefcrash fix: Guardedbuild_spec()to safely ignore static route definitions (routes.static(...)) without raisingAttributeError.- Tightened WebSocket detection: Replaced broad substring matching with strict path segment regex (
r"(^|/)(ws|websocket)(/|$)") to ensure standard routes like/api/newsare never falsely excluded. - Fixed
NotAppKeyWarning: Replaced string application keys with modern, typedaiohttp.web.AppKeyinstances for full compatibility withaiohttp>=3.9. - Trailing slash redirect: Fixed
/docs/redirect behavior to preserve proper status codes.
Automated Testing & CI/CD
- Full Test Suite (
tests/): Added unit and integration tests covering@docs()decorator metadata, Pydantic v2 & dict schema extraction, OpenAPI spec generator, Swagger UI rendering, and async HTTP handlers. - GitHub Actions CI Matrix: Automated testing across Python 3.11, 3.12, and 3.13 using
uv. - Automated PyPI Deployment: Integrated release workflow with test gating.
Documentation & Examples
- Added runnable standalone examples in
examples/demonstrating both zero-dependency dict schemas and Pydantic v2 integrations. - Added comprehensive
CONTRIBUTING.mdguide withuvenvironment commands.
Full Changelog: https://github.com/kappall/aiohttp_autodocs/commits/main
v0.1.0 Initial public release
This is the first public release of aiohttp-autodocs, a zero-overhead OpenAPI 3.1 documentation generator for aiohttp.
Key Features
- Zero runtime overhead: Spec is built at startup and cached as frozen bytes
- Non-invasive
@docs()decorator: Strongly-typed Python, no YAML or request interception - Pydantic v2 support: Extracts JSON schemas from Pydantic models, degrades to raw dicts if unavailable
- OpenAPI 3.1 + Swagger UI v5: Interactive "Try it out" UI at
/docs - Zero extra dependencies: Only requires
aiohttp
Basic Usage
from aiohttp import web
from aiohttp_autodocs import docs, build_openapi, OpenAPIConfig
from pydantic import BaseModel
class AlarmSchema(BaseModel):
id: int
message: str
routes = web.RouteTableDef()
@docs(
summary="List all alarms",
tags=["Alarms"],
response=AlarmSchema,
response_list=True
)
@routes.get("/api/v1/alarms")
async def get_alarms(request: web.Request) -> web.Response:
return web.json_response([{"id": 1, "message": "High CPU"}])
app = web.Application()
app.add_routes(routes)
build_openapi(
app,
OpenAPIConfig(title="My API", version="1.0.0"),
routes
)Open http://localhost:8080/docs to view the documentation.
Installation
pip install aiohttp-autodocs[pydantic]More details in the README.
Full Changelog: https://github.com/kappall/aiohttp_autodocs/commits/v0.1.0