Skip to main content

validate_event

Function validate_event 

Source
pub fn validate_event<T: VldParse>(
    event: LambdaEvent<Value>,
) -> Result<(T, Context), Diagnostic>
Expand description

Validate the payload of a raw lambda_runtime event (SQS, EventBridge, a direct invocation, …) and hand back the payload and its context.

ⓘ
async fn handler(event: LambdaEvent<serde_json::Value>) -> Result<String, Diagnostic> {
    let (order, _ctx) = vld_web::lambda::validate_event::<Order>(event)?;
    Ok(order.id)
}