Expand description
Webhook payload transformation
Transform incoming webhook payloads before passing to workflows.
§Example
use oxify_model::{
PayloadTransform, TransformOperation, FieldMapping,
TransformPipeline, PayloadTransformError,
};
use serde_json::json;
// Create a transform that extracts and renames fields
let transform = PayloadTransform::new()
.extract_field("$.data.user", "user")
.rename_field("$.action", "event_type")
.add_default("source", json!("webhook"))
.filter_fields(&["user", "event_type", "source"]);
// Apply the transform
let input = json!({
"action": "user.created",
"data": {
"user": { "id": 123, "name": "Alice" }
}
});
let result = transform.apply(&input).unwrap();
// result = { "user": { "id": 123, "name": "Alice" }, "event_type": "user.created", "source": "webhook" }Structs§
- Field
Mapping - Field mapping for bulk rename/extract operations
- Payload
Transform - Payload transformation configuration
- Transform
Pipeline - Transformation pipeline for chaining multiple transforms
Enums§
- Payload
Transform Error - Error type for payload transformation
- String
Transform Type - String transformation types
- Transform
Operation - A single transformation operation