Details
| ID | JsonUnescape |
|---|---|
| Language | python |
| From Version | 6.0.0 |
| Docker Image | demisto/python3-deb:3.12.13.12042988 |
| Tags | transformer |
README
Recursively un-escapes JSON data if escaped JSON is found
Script Data
| Name | Description |
|---|---|
| Script Type | python3 |
| Tags | transformer |
Inputs
| Argument Name | Description |
|---|---|
| value | JSON object |
Outputs
| Path | Description | Type |
|---|---|---|
| JsonUnescape | Unescaped JSON Data | Unknown |
def test_hook(): """ Given - A string value representing a json When - Running the hook function Then - Ensure the string value is converted to json """ from JsonUnescape import hook assert hook({"key": "value"}) == {"key": "value"} assert hook({"key": "{'key': 'value'}"}) == {"key": "{'key': 'value'}"} def test_unescape(): """ Given - A dictionary with a string value When - Running the unescape function Then - Ensure the string value is converted to json """ from JsonUnescape import unescape assert unescape({"value": "value"}) == "value" assert unescape({"value": "{'key': 'value'}"}) == "{'key': 'value'}"