Skip to content

get_response_schema

faststream.specification.asyncapi.message.get_response_schema #

get_response_schema(call: None, prefix: str = '') -> None
get_response_schema(
    call: CallModel, prefix: str = ""
) -> dict[str, Any]
get_response_schema(call, prefix='')

Get the response schema for a given call.

Source code in faststream/specification/asyncapi/message.py
def get_response_schema(
    call: Optional["CallModel"],
    prefix: str = "",
) -> dict[str, Any] | None:
    """Get the response schema for a given call."""
    return get_model_schema(
        getattr(
            call,
            "response_model",
            None,
        ),  # NOTE: FastAPI Dependant object compatibility
        prefix=prefix,
    )