TPLWorkflowJSONOptions
Native Pascal, workflow preparation
Description
TPLWorkflowJSONOptions holds the parser budgets consumed by PLParseWorkflowJSONEx. Start from PLDefaultWorkflowJSONOptions and raise or lower a field for the request size and the trust placed in the input; the plain PLParseWorkflowJSON entry point always uses these defaults.
The limits are independent: the source length is checked before parsing, while depth, node count and children per container are enforced as the parser descends, so a small document with deep nesting still fails.
Syntax
Delphi
TPLWorkflowJSONOptions = Record
MaxLength, MaxDepth, MaxNodes, MaxContainerItems: Integer;
End;Fields
| MaxLength | Maximum source length of 33,554,432 UTF-16 code units (32 Mi) by default; a negative value is invalid |
|---|---|
| MaxDepth | Maximum nesting depth from 0 through 256; the default is 64 |
| MaxNodes | Maximum number of parsed values, at least 1; the default is 250,000 |
| MaxContainerItems | Maximum children of any one object or array; the default is 10,000 and zero admits only empty containers |
Remarks
The defaults are 33,554,432 UTF-16 code units, depth 64, 250,000 nodes and 10,000 children per container.
Exceeding a limit fails the parse and sets BudgetExceeded in TPLWorkflowJSONError; invalid option values also fail, but do not set that flag.
The record is plain data with no managed fields, so it can be copied and stored by value.
See also
WorkflowDataTools, TPLWorkflowJSON, TPLWorkflowJSONError, ProbeWorkflowRequest