in src/functions_framework/event_conversion.py [0:0]
def _is_raw_pubsub_payload(request_data) -> bool:
"""Does the given request body match the schema of a unmarshalled Pub/Sub request"""
return (
request_data is not None
and "context" not in request_data
and "subscription" in request_data
and "message" in request_data
and "data" in request_data["message"]
and "messageId" in request_data["message"]
)