AsyncAPI plugin for Litestar
Project description
litestar-asyncapi
AsyncAPI support for Litestar applications. This plugin generates AsyncAPI 3.0 documents for WebSocket routes and (best-effort) ChannelsPlugin channels, and provides JSON/YAML/UI renderers.
Usage
from litestar import Litestar
from litestar_asyncapi import AsyncAPIConfig, AsyncAPIPlugin
config = AsyncAPIConfig(
use_handler_docstrings=True,
create_examples=True,
random_seed=1,
)
app = Litestar(plugins=[AsyncAPIPlugin(config=config)])
By default, the plugin serves docs at /asyncapi/ with JSON at /asyncapi/asyncapi.json and YAML at /asyncapi/asyncapi.yaml.
When enabled, docstrings and handler metadata (summary, description, operation_id) are used to enrich AsyncAPI operations, and example payloads are generated for message schemas. AsyncAPI decorators still take precedence over inferred metadata.
Documentation
Build the docs locally:
make docs
Link check:
make docs-linkcheck
The HTML output is written to docs/_build/html. The GitHub Pages deployment is handled by the docs workflow.
CI and Release
- CI runs linting, type checks, and test matrix across supported Python versions.
- The release workflow is
publish.yml(workflow name:pypi) and publishes to PyPI on GitHub release.
Notes
- Operation IDs are generated deterministically and are unique across the document.
- Channel message references are emitted under each channel, with operations referencing those messages.
- Component key overrides are sanitized to valid schema component names.
- Channel parameter schemas are filtered to AsyncAPI v3-compatible fields.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file litestar_asyncapi-0.1.0.tar.gz.
File metadata
- Download URL: litestar_asyncapi-0.1.0.tar.gz
- Upload date:
- Size: 212.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bfde4d0963d56aa4a39c3b8c4db0ea8b8032f523df40f4b166ac663c3a60bbff
|
|
| MD5 |
f9d1e888bfc9de99d6031b282db6ef3b
|
|
| BLAKE2b-256 |
0423f98915f3ee8663e922cd6bd7b5341f5ca25675f0cf74a1b9cfa976cd8763
|
Provenance
The following attestation bundles were made for litestar_asyncapi-0.1.0.tar.gz:
Publisher:
publish.yml on cofin/litestar-asyncapi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
litestar_asyncapi-0.1.0.tar.gz -
Subject digest:
bfde4d0963d56aa4a39c3b8c4db0ea8b8032f523df40f4b166ac663c3a60bbff - Sigstore transparency entry: 778320389
- Sigstore integration time:
-
Permalink:
cofin/litestar-asyncapi@b59b3050a73b2e313b6e3bee9df2ac27e6425789 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/cofin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b59b3050a73b2e313b6e3bee9df2ac27e6425789 -
Trigger Event:
release
-
Statement type:
File details
Details for the file litestar_asyncapi-0.1.0-py3-none-any.whl.
File metadata
- Download URL: litestar_asyncapi-0.1.0-py3-none-any.whl
- Upload date:
- Size: 49.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69443e938530f56b9de5572768b4a505311a556c98ca9174a01a3843b11bb28a
|
|
| MD5 |
dad4849e82cee2ff81f9c67bcacd69ac
|
|
| BLAKE2b-256 |
6979cc15a5233cc11e80ec17d3779bc1ebb47d58b62f0989fa8547ad75f6baa3
|
Provenance
The following attestation bundles were made for litestar_asyncapi-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on cofin/litestar-asyncapi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
litestar_asyncapi-0.1.0-py3-none-any.whl -
Subject digest:
69443e938530f56b9de5572768b4a505311a556c98ca9174a01a3843b11bb28a - Sigstore transparency entry: 778320418
- Sigstore integration time:
-
Permalink:
cofin/litestar-asyncapi@b59b3050a73b2e313b6e3bee9df2ac27e6425789 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/cofin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b59b3050a73b2e313b6e3bee9df2ac27e6425789 -
Trigger Event:
release
-
Statement type: