beetlebug▾
/

ztcl::json raw

Checks a JSON text and gives it as it is.

ztcl::json raw JSON

Description

Gives JSON with no change after a check that it is valid JSON, for a value of object or array that comes from elsewhere.

Arguments

ArgumentTypeDefaultDescription
JSONJSON textrequiredThe text.

Returns

The JSON text.

Examples

Each example of this page runs after package require ztcl::json.

% ztcl::json raw {[1, 2]}
[1, 2]

Errors

% ztcl::json raw {[1,}
json syntax error at line 1, column 4: value expected
-errorcode ZT JSON SYNTAX 1 4

Facts

Capability
None.
Tcl release
Tcl 9.1 and 8.6.
Since
ztcl 1.0.0-beta.1

See also