fastest-asyncapi
Use pydantic model to construct asyncapi docs and serve inside your asyncapi app
Installation
Install using pip or poetry
poetry add fastest-asyncapi
Usage
- Describe your specification using pydantic models
from asyncapi_container.asyncapi.spec.v3.info import Info
from asyncapi_container.containers.v3.simple_spec import SimpleSpecV3
from asyncapi_container.custom_types import RoutingMap
from pydantic import BaseModel, Field
class Customer(BaseModel):
first_name: str = Field(..., title='First Name')
last_name: str = Field(..., title='Last Name')
email: str = Field(..., title='Email', format="email", description="Person's email to deliver order info")
country: str = Field(..., title='Country')
zipcode: str = Field(..., title='Zipcode')
city: str = Field(..., title='City')
street: str = Field(..., title='Street')
apartment: str = Field(..., title='Apartment')
class OrderSchemaV1(BaseModel):
product_id: int = Field(..., title='Product Id')
quantity: int = Field(..., title='Quantity')
customer: Customer
class MySpecialServiceAsyncAPISpecV3(SimpleSpecV3):
info: Info = Info(
title="My special Service",
version="1.0.0",
description="Service for making orders"
)
sends: RoutingMap = {
"shop.orders.v1": [
OrderSchemaV1,
]
}
receives: RoutingMap = {}
- Configure
fast-and-async-apiapp using asyncapi spec definition from above Mountfastapi-asyncapiurls.
from fastapi import FastAPI
from fastest_asyncapi.views.sync.v3.asyncapi import fastest_asyncapi_app
app = FastAPI()
fastest_asyncapi_app.configure(asyncapi_spec_classes=[MySpecialServiceAsyncAPISpecV3])
app.mount("/docs/", fastest_asyncapi_app)
- Enjoy your results by navigating to
docs/asyncapi/v3/
PS: images generated by AI
Metadata
Release files for fastapi-asyncapi-docs 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| fastapi_asyncapi_docs-0.1.0.tar.gz | 5.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fastapi_asyncapi_docs-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.0 kB
Release files / fastapi_asyncapi_docs-0.1.0.tar.gz
| Download URL | fastapi_asyncapi_docs-0.1.0.tar.gz |
|---|---|
| Size | 5.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
af53949c8ba9511a8432d8550b3f2a73510ff567bc618b3f89103f8a1649050c
|
|
BLAKE2b-256 checksum How to use checksums |
a0fece96b355be6ebec2d73d5274d68a621bc5b46e0f449cb54c85eb42dbc8c9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.11.2 Darwin/22.3.0
|
Release files / fastapi_asyncapi_docs-0.1.0-py3-none-any.whl
| Download URL | fastapi_asyncapi_docs-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1fa5ecc85f24f065d0c998a69d54be0dbdc91c69c413106db06f7a7b6095edc7
|
|
BLAKE2b-256 checksum How to use checksums |
7d87ede663fe03ea2e3e9fcd7aad5a36eef8005674619e13fe780477ee362e86
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.11.2 Darwin/22.3.0
|
Security for fastapi-asyncapi-docs 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.