From 921ead86e4535be8bf70e0c211bc0246fdfb8f44 Mon Sep 17 00:00:00 2001 From: Nikita Pastukhov Date: Wed, 20 Nov 2024 21:42:39 +0300 Subject: [PATCH] fix: correct AsyncAPI 2.6 operations --- .../specification/asyncapi/v2_6_0/schema/channels.py | 8 ++++---- serve.py | 9 --------- 2 files changed, 4 insertions(+), 13 deletions(-) delete mode 100644 serve.py diff --git a/faststream/specification/asyncapi/v2_6_0/schema/channels.py b/faststream/specification/asyncapi/v2_6_0/schema/channels.py index 936248dfd5..5310578554 100644 --- a/faststream/specification/asyncapi/v2_6_0/schema/channels.py +++ b/faststream/specification/asyncapi/v2_6_0/schema/channels.py @@ -48,8 +48,8 @@ def from_sub(cls, subscriber: SubscriberSpec) -> Self: description=subscriber.description, servers=None, bindings=ChannelBinding.from_sub(subscriber.bindings), - subscribe=Operation.from_sub(subscriber.operation), - publish=None, + subscribe=None, + publish=Operation.from_sub(subscriber.operation), ) @classmethod @@ -58,6 +58,6 @@ def from_pub(cls, publisher: PublisherSpec) -> Self: description=publisher.description, servers=None, bindings=ChannelBinding.from_pub(publisher.bindings), - subscribe=None, - publish=Operation.from_pub(publisher.operation), + subscribe=Operation.from_pub(publisher.operation), + publish=None, ) diff --git a/serve.py b/serve.py deleted file mode 100644 index bc0a693167..0000000000 --- a/serve.py +++ /dev/null @@ -1,9 +0,0 @@ -from faststream import FastStream -from faststream.rabbit import RabbitBroker - -broker = RabbitBroker() -app = FastStream(broker) - -@app.after_startup -async def _(): - raise ValueError