bmel:json-omit¶
Category: JSON · Returns: bmel:string
Signature
bmel:json-omit(object: bmel:any, keys: bmel:array)
Description¶
Returns a new JSON string with the specified top-level keys removed from the input object. The inverse of bmel:json-pick. Useful for sanitizing sensitive or PII fields (e.g. removing 'user', 'api_key', 'authorization' fields from a request snapshot) before persisting to a frame component. Keys not present in the input are silently ignored. Supports dot-notation keys for nested omits.
Arguments¶
| Parameter | Type | Required | Description |
|---|---|---|---|
object | bmel:any | The source JSON object or string to remove keys from. | |
keys | bmel:array | Array of key names (strings) to exclude from the output. Supports dot-notation for nested paths. |
Examples¶
Request without the fields listed as sensitive
bmel:json-omit({invokeAgent:Request Payload}.$.body, {invokeAgent:Request Payload}.$.policy.sensitive_fields)
Output without the fields the caller asked to hide
bmel:json-omit({invokeAgent:Response Payload}.$.output, {invokeAgent:Request Payload}.$.options.hidden_fields)