Format JSON

Reformats a JSON string with control over indentation, line breaking, and spacing. Trailing commas are tolerated. Otherwise-invalid JSON input is returned unchanged.

Interface

Inputs

ParameterDetailsPossible Types
JSON

The JSON string to reformat.

Primary Input

String[]
String
Compact

Removes optional spaces within curly brackets and after colons and commas.

Default: false

bool[]
bool
Multi-Line

Break arrays and objects across multiple lines when they exceed the line break length.

Default: true

bool[]
bool
Indent

The indentation string used for each nesting level. Escape sequences like \t (the tab character) are supported. Two or four spaces are also common choices.

Default: \t

String[]
String
Break Length

The maximum line length before a container (array or object) is broken across lines. Set this to 0 to always break containers. (Requires Multi-Line to take effect.)

This is not a maximum line length guarantee. Deep nesting and long keys or values may exceed this length.

Default: 120

u32[]
u32
Break Nested

Always break a container (array or object) across lines if it holds another container, even if it would fit within the break length. (Requires Multi-Line to take effect.)

Default: true

bool[]
bool

Outputs

ProductDetailsPossible Types
Result

The value produced by the node operation.

Primary Output

String
String[]