Skip to content

get_response_schema

faststream.asyncapi.message.get_response_schema #

get_response_schema(call, prefix='')

Get the response schema for a given call.

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