Skip to content

ApplicationSchema

faststream.specification.asyncapi.v2_6_0.schema.ApplicationSchema #

Bases: BaseApplicationSchema

A class to represent an application schema.

title property #

title: str

info instance-attribute #

asyncapi instance-attribute #

asyncapi: Literal['2.6.0'] | str

id class-attribute instance-attribute #

id: str | None = None

defaultContentType class-attribute instance-attribute #

defaultContentType: str | None = None

servers class-attribute instance-attribute #

servers: dict[str, Server] | None = None

channels instance-attribute #

channels: dict[str, Channel]

components class-attribute instance-attribute #

components: Components | None = None

tags class-attribute instance-attribute #

tags: list[Tag | dict[str, Any]] | None = None

externalDocs class-attribute instance-attribute #

externalDocs: ExternalDocs | dict[str, Any] | None = None

to_jsonable #

to_jsonable() -> Any

Convert the schema to a JSON-serializable object.

Source code in faststream/specification/base/schema.py
def to_jsonable(self) -> Any:
    """Convert the schema to a JSON-serializable object."""
    return model_to_jsonable(
        self,
        by_alias=True,
        exclude_none=True,
    )

to_json #

to_json() -> str

Convert the schema to a JSON string.

Source code in faststream/specification/base/schema.py
def to_json(self) -> str:
    """Convert the schema to a JSON string."""
    return model_to_json(
        self,
        by_alias=True,
        exclude_none=True,
    )

to_yaml #

to_yaml() -> str

Convert the schema to a YAML string.

Source code in faststream/specification/base/schema.py
def to_yaml(self) -> str:
    """Convert the schema to a YAML string."""
    from io import StringIO

    import yaml

    io = StringIO(initial_value="", newline="\n")
    yaml.dump(self.to_jsonable(), io, sort_keys=False)
    return io.getvalue()