From 7d39128e0e619aca565d4e4ec408535d5c45c0bb Mon Sep 17 00:00:00 2001 From: Vladimir Kibisov Date: Tue, 24 Sep 2024 22:35:32 +0300 Subject: [PATCH] merge conflict fix --- faststream/app.py | 3 +-- faststream/asgi/app.py | 16 ------------ faststream/specification/asyncapi/generate.py | 25 ------------------- 3 files changed, 1 insertion(+), 43 deletions(-) delete mode 100644 faststream/specification/asyncapi/generate.py diff --git a/faststream/app.py b/faststream/app.py index 20de28feac..8565e847ba 100644 --- a/faststream/app.py +++ b/faststream/app.py @@ -7,7 +7,6 @@ Sequence, Tuple, TypeVar, - Union, ) import anyio @@ -15,7 +14,7 @@ from faststream._internal._compat import ExceptionGroup from faststream._internal.application import Application -from faststream._internal.basic_types import AnyDict, AnyHttpUrl, Lifespan, LoggerProto +from faststream._internal.basic_types import Lifespan, LoggerProto from faststream._internal.broker.broker import BrokerUsecase from faststream._internal.cli.supervisors.utils import set_exit from faststream._internal.log import logger diff --git a/faststream/asgi/app.py b/faststream/asgi/app.py index 94abdda369..2c74344d79 100644 --- a/faststream/asgi/app.py +++ b/faststream/asgi/app.py @@ -12,7 +12,6 @@ Protocol, Sequence, Tuple, - Union, ) import anyio @@ -32,18 +31,12 @@ from faststream._internal.basic_types import ( AnyCallable, - AnyDict, - AnyHttpUrl, Lifespan, LoggerProto, SettingField, ) from faststream._internal.broker.broker import BrokerUsecase from faststream.asgi.types import ASGIApp, Receive, Scope, Send - from faststream.specification.schema.contact import Contact, ContactDict - from faststream.specification.schema.docs import ExternalDocs, ExternalDocsDict - from faststream.specification.schema.license import License, LicenseDict - from faststream.specification.schema.tag import Tag, TagDict class UvicornServerProtocol(Protocol): should_exit: bool @@ -129,15 +122,6 @@ def from_app( asyncapi_path=asyncapi_path, logger=app.logger, lifespan=None, - title=app.title, - version=app.version, - description=app.description, - terms_of_service=app.terms_of_service, - license=app.license, - contact=app.contact, - tags=app.specification_tags, - external_docs=app.external_docs, - identifier=app.identifier, ) asgi_app.lifespan_context = app.lifespan_context asgi_app._on_startup_calling = app._on_startup_calling diff --git a/faststream/specification/asyncapi/generate.py b/faststream/specification/asyncapi/generate.py deleted file mode 100644 index a30e0910a9..0000000000 --- a/faststream/specification/asyncapi/generate.py +++ /dev/null @@ -1,25 +0,0 @@ -from typing import TYPE_CHECKING, Literal, Union - -from faststream.specification.asyncapi.base.schema import BaseSchema -from faststream.specification.asyncapi.v2_6_0.generate import ( - get_app_schema as get_app_schema_v2_6, -) -from faststream.specification.asyncapi.v3_0_0.generate import ( - get_app_schema as get_app_schema_v3, -) - -if TYPE_CHECKING: - from faststream.specification.proto import SpecApplication - - -def get_app_schema( - app: "SpecApplication", - version: Union[Literal["3.0.0", "2.6.0"], str] = "3.0.0", -) -> BaseSchema: - if version.startswith("3.0."): - return get_app_schema_v3(app) - - if version.startswith("2.6."): - return get_app_schema_v2_6(app) - - raise NotImplementedError(f"AsyncAPI version not supported: {version}")