Skip to content

SpecificationFactory

faststream.specification.base.generator.SpecificationFactory #

Bases: Protocol

title instance-attribute #

title: str

description instance-attribute #

description: str | None

version instance-attribute #

version: str | None

contact instance-attribute #

contact: Union[Contact, dict[str, Any]] | None

license instance-attribute #

license: Union[License, dict[str, Any]] | None

add_broker abstractmethod #

add_broker(
    broker: BrokerUsecase[Any, Any],
) -> SpecificationFactory
Source code in faststream/specification/base/generator.py
@abstractmethod
def add_broker(
    self,
    broker: "BrokerUsecase[Any, Any]",
    /,
) -> "SpecificationFactory":
    raise NotImplementedError

add_http_route abstractmethod #

add_http_route(
    path: str, handler: HttpHandler
) -> SpecificationFactory
Source code in faststream/specification/base/generator.py
@abstractmethod
def add_http_route(
    self,
    path: str,
    handler: "HttpHandler",
) -> "SpecificationFactory":
    raise NotImplementedError

to_specification abstractmethod #

to_specification() -> Specification
Source code in faststream/specification/base/generator.py
@abstractmethod
def to_specification(self) -> Specification:
    raise NotImplementedError