We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
from dataclasses import dataclass, field from faststream.rabbit import RabbitBroker from faststream.specification import AsyncAPI @dataclass class PartnerOrderProduct: product_uid: str @dataclass class PartnerOrderPayload: uid: str status: str date: str products: list[PartnerOrderProduct] = field(default_factory=list) broker = RabbitBroker() @broker.subscriber(queue="test") async def partner_order_to_1c( payload: PartnerOrderPayload, ): print(payload) docs = AsyncAPI(broker)
Generated schema
{ "info": { "title": "FastStream", "version": "0.1.0", "description": "" }, "asyncapi": "3.0.0", "defaultContentType": "application/json", "servers": { "development": { "host": "admin:admin@localhost:5672", "pathname": "/robots", "protocol": "amqp", "protocolVersion": "0.9.1" } }, "channels": { "test:_:PartnerOrderTo1C": { "address": "test:_:PartnerOrderTo1C", "servers": [ { "$ref": "#/servers/development" } ], "messages": { "SubscribeMessage": { "$ref": "#/components/messages/test:_:PartnerOrderTo1C:SubscribeMessage" } }, "bindings": { "amqp": { "is": "queue", "bindingVersion": "0.3.0", "queue": { "name": "test", "durable": false, "exclusive": false, "autoDelete": false, "vhost": "/robots" } } } } }, "operations": { "test:_:PartnerOrderTo1CSubscribe": { "action": "receive", "channel": { "$ref": "#/channels/test:_:PartnerOrderTo1C" }, "bindings": { "amqp": { "cc": [ "test" ], "ack": true, "bindingVersion": "0.3.0" } }, "messages": [ { "$ref": "#/channels/test:_:PartnerOrderTo1C/messages/SubscribeMessage" } ] } }, "components": { "messages": { "test:_:PartnerOrderTo1C:SubscribeMessage": { "title": "test:_:PartnerOrderTo1C:SubscribeMessage", "correlationId": { "location": "$message.header#/correlation_id" }, "payload": { "$ref": "#/components/schemas/PartnerOrderPayload" } } }, "schemas": { "PartnerOrderPayload": { "properties": { "uid": { "title": "Uid", "type": "string" }, "status": { "title": "Status", "type": "string" }, "date": { "title": "Date", "type": "string" }, "products": { "items": { "$ref": "#/components/schemas/PartnerOrderProduct" # there is no such schema }, "title": "Products", "type": "array" } }, "required": [ "uid", "status", "date" ], "title": "PartnerOrderPayload", "type": "object" } } } }
The text was updated successfully, but these errors were encountered:
.
Sorry, something went wrong.
pepellsd
No branches or pull requests
Generated schema
The text was updated successfully, but these errors were encountered: