Details
| ID | LoadJSON |
|---|---|
| Language | python |
| From Version | 5.0.0 |
| Docker Image | demisto/python3:3.12.13.10116658 |
| Tags | Utility |
README
LoadJSON
Loads a JSON from a string input, and returns a JSON object result.
Script Data
| Name | Description |
|---|---|
| Script Type | python3 |
| Tags | Utility |
Inputs
| Argument Name | Description |
|---|---|
| input | The input string to transform to a JSON object. |
Outputs
| Path | Description | Type |
|---|---|---|
| JsonObject | The JSON object loaded from the input. | Unknown |
import pytest from LoadJSON import load_json @pytest.mark.parametrize("inputs, outputs", [('{"a": 1}', {"a": 1}), ('{"a": "b t"}', {"a": "b t"})]) def test_load_json(inputs, outputs): assert outputs == load_json({"input": inputs})["Contents"] def test_load_json_failure(): with pytest.raises(ValueError): load_json({"input": "not json at all"})