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 fastest-asyncapi 0.1.5
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 | |
|---|---|---|---|---|
| fastest_asyncapi-0.1.5.tar.gz | 3.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fastest_asyncapi-0.1.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.9 kB
Release files / fastest_asyncapi-0.1.5.tar.gz
| Download URL | fastest_asyncapi-0.1.5.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
83756c4b1da66d44f0ca86ddceccdc7188933e4d23f792e00f7ffa9ea0205d0c
|
|
BLAKE2b-256 checksum How to use checksums |
cfc9c675af0e4f39a49299298509b600efea86a8293d8d5b9fe0ac279139c515
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.3 CPython/3.11.9 Darwin/22.6.0
|
Release files / fastest_asyncapi-0.1.5-py3-none-any.whl
| Download URL | fastest_asyncapi-0.1.5-py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9858113f999c3eb7ad6dac467261f4c38ac5c5a6a4b87ea27209de6e8cef1a95
|
|
BLAKE2b-256 checksum How to use checksums |
9d00f429f707907ba8849d9d8b2bd20104056dd3da56dcea4498c3883262783e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.3 CPython/3.11.9 Darwin/22.6.0
|
Security for fastest-asyncapi 0.1.5
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.