Skip to main content

JSON elements writer

Generate a JSON file on which you can append multiple JSON elements at the given JSON path.

Example
// 1st input:
{ "hello": "World" }

// 2nd input:
{ "hello": "France" }

// Configuration:
// JSON path: data

// Output:
{
"data": [{ "hello": "World" }, { "hello": "France" }]
}

Parameters

JSON path

The key under which the elements array is placed. This is a plain key, not a JSONPath expression. When left empty, the output is a bare top-level array. A dotted value nests objects: data.items produces {"data": {"items": [ ... ]}}.

Base object

A JSON object the output is merged into: its keys are written at the top level of the output document, alongside the JSON path key holding the elements array.

Pretty

If checked, the JSON file will be formatted with indentation and lines. Off by default (compact output).

Input

JSON elementrequired

All the JSON elements to append to the JSON file. It accepts fragment of JSON which will be merged if possible, or overwritten. For example:

Fragments of JSON
{"name": "John"}
{"age": "27"}
{"age": "42"}
Merged JSON
{"name": "John", "age": "42"}

Each element must be a JSON object; any other JSON value fails the run.