Prototype: parsejson(json_data)
Return type: data
Description: Parses JSON data directly from an inlined string and returns the result as a data
variable
Arguments:
json_data
: string
- JSON string to parse - in the range: .*
Please note that because JSON uses double quotes, it's usually most convenient to use single quotes for the string (CFEngine allows both types of quotes around a string).
This function can accept many types of data parameters.
Example:
code
vars:
"loadthis"
data => parsejson('{ "key": "value" }');
# inline syntax since 3.7
"loadthis_inline"
data => '{ "key": "value" }';
Notes:
History:
See also: readjson()
, parseyaml()
, readyaml()
, mergedata()
, Inline YAML and JSON data
, about collecting functions, and data
documentation.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4