Flatten Json

petr_cermak/flatten-json

This act extracts all arrays from input JSON and extends their elements with the core object.

Modified
Last run
Used 28 times

act-flatten-json

This act extracts all arrays from input JSON and extends their elements with the core object.

Example input:

[
    {
        "name": "elem_1",
        "value": ["a", "b", "c"]
    },
    {
        "name": "elem_2",
        "value": ["d", "e"]
    }
]

Example output:

[
    { "name": "elem_1", "value": "a" },
    { "name": "elem_1", "value": "b" },
    { "name": "elem_1", "value": "c" },
    { "name": "elem_2", "value": "d" },
    { "name": "elem_2", "value": "e" }
]