HTTP & JSON
jsonParse
$jsonParse[]
Parses a JSON string into the internal JSON structure, replacing any existing JSON context.
Syntax
$jsonParse[json]
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| json | string | check_circle Required | — | A valid JSON string to parse. Must be well-formed JSON — invalid JSON will cause an error. |
Return Value
void
Loads the parsed JSON into the internal context. All subsequent JSON functions operate on this parsed structure.
$jsonParse is the primary way to load external JSON data — such as API responses, file contents, or user input — into the BDFD JSON system. It replaces whatever internal JSON structure currently exists. Use $jsonStringify to convert back to a string when done. The input must be strictly valid JSON; malformed input will produce an error.
Examples
Parse a JSON string from an API response
$httpGet[https://api.example.com/users]
$jsonParse[$httpResult]
First user: $jsonValue[users;0;name]
Parse and query a JSON string
$jsonParse[{"name":"Alice","age":25}]
Name: $jsonValue[name]
Age: $jsonValue[age]
Parse JSON from a variable
$var[raw;{"items":["apple","banana","cherry"]}]
$jsonParse[$var[raw]]
Item count: $jsonArrayCount[items]