Skip to content

SpecificationFactory

faststream.specification.base.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, Any],
) -> SpecificationFactory
Source code in faststream/specification/base/generator.py
21
22
23
24
25
26
27
@abstractmethod
def add_broker(
    self,
    broker: "BrokerUsecase[Any, 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
29
30
31
32
33
34
35
@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
37
38
39
@abstractmethod
def to_specification(self) -> Specification:
    raise NotImplementedError