util::json::gen (public, deprecated)
util::json::gen value
Defined in packages/acs-tcl/tcl/json-procs.tcl
Deprecated. Invoking this procedure generates a warning.
Generate JSON from the legacy tagged Tcl list format. Prefer ns_json value with explicit JSON types for new code. When ns_json is available, this wrapper encodes the legacy values with the native serializer. Strings that look like JSON numbers, booleans or null are still inferred as those types.
- Parameters:
- value (required)
- A two-element object/array Tcl list.
- Returns:
- A JSON string.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- legacy_json_generation
Source code: ad_log_deprecated proc util::json::gen if { [llength $value] != 2 } { return -code error "Ill-formed JSON object: length in gen is [llength $value]" } if {[::acs::icanuse "ns_json"]} { lassign [legacy_value_to_json_type $value] type payload return [ns_json value -type $type -- $payload] } return [util::json::gen_inner $value]XQL Not present: Generic, PostgreSQL, Oracle