Movatterモバイル変換


[0]ホーム

URL:


CFEngine documentation homepage

parsejson

Suggest changes
Table of contents

Prototype:parsejson(json_data)

Return type:data

Description: Parses JSON data directly from an inlined string andreturns the result as adata variable

Arguments:

  • json_data:string - JSON string to parse - in the range:.*

Please note that because JSON uses double quotes, it's usually mostconvenient to use single quotes for the string (CFEngine allows bothtypes 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:

  • This functions does not parseprimitives.

History:

See also:readjson(),parseyaml(),readyaml(),mergedata(),Inline YAML and JSON data,about collecting functions, anddata documentation.

Still need help?

Chat Ask a question on Github Mailing list
Version 
master3.24 (LTS)3.21 (LTS)view all versions

[8]ページ先頭

©2009-2025 Movatter.jp