SerializeFormatted

Native Pascal, workflow preparation

Description

Serialises the value to formatted JSON text. Indent is the number of spaces per nesting level and must be 0 through 16; a positive indent breaks children onto separate lines terminated with LF and places a space after each name colon, while 0 emits one line without spaces. SortNames sorts the members of every object by name compared as UTF-16 code units; arrays keep their order.

Formatting validates the stored texts — a number or boolean whose stored text is not a valid JSON spelling raises an exception — and enforces the shared 256-level depth, 250,000-node and 32 Mi output limits.

Syntax

Delphi

Function TPLWorkflowJSON.SerializeFormatted(Indent: Integer; SortNames: Boolean): WideString;

Parameters

IndentSpaces per nesting level, 0 through 16; values outside that range raise an exception
SortNamesTrue sorts every object's members by name for repeatable output

Return values

WideStringThe formatted JSON representation of the value

Remarks

The result is stable, readable formatting — for example SerializeFormatted(2, True) for repeatable request files — not a cryptographic JSON canonicalisation; compact Serialize is unaffected.

See also

WorkflowDataTools, ProbeWorkflowRequest