Skip to content

Releases: kappall/aiohttp_autodocs

v0.1.8

Choose a tag to compare

@kappall kappall released this 06 Sep 11:48
Immutable release. Only release title and notes can be modified.
7ab777a

What's Changed

Full Changelog: v0.1.7...v0.1.8

v0.1.7 - Bug Fixes, Test Suite & Automated CI/CD

Choose a tag to compare

@kappall kappall released this 30 Aug 08:01
Immutable release. Only release title and notes can be modified.

Highlights in this Release

Bug Fixes & Stability

  • StaticDef crash fix: Guarded build_spec() to safely ignore static route definitions (routes.static(...)) without raising AttributeError.
  • Tightened WebSocket detection: Replaced broad substring matching with strict path segment regex (r"(^|/)(ws|websocket)(/|$)") to ensure standard routes like /api/news are never falsely excluded.
  • Fixed NotAppKeyWarning: Replaced string application keys with modern, typed aiohttp.web.AppKey instances for full compatibility with aiohttp>=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.md guide with uv environment commands.

Full Changelog: https://github.com/kappall/aiohttp_autodocs/commits/main

v0.1.0 Initial public release

Choose a tag to compare

@kappall kappall released this 12 Jun 16:41

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