func_json: Enhance parsing capabilities of JSON_DECODE

Adds support for arrays to JSON_DECODE by allowing the
user to print out entire arrays or index a particular
key or print the number of keys in a JSON array.

Additionally, adds support for recursively iterating a
JSON tree in a single function call, making it easier
to parse JSON results with multiple levels. A maximum
depth is imposed to prevent potentially blowing
the stack.

Also fixes a bug with the unit tests causing an empty
string to be printed instead of the actual test result.

ASTERISK-29913 #close

Change-Id: I603940b216a3911b498fc6583b18934011ef5d5b
This commit is contained in:
Naveen Albert
2022-02-12 21:59:52 +00:00
committed by George Joseph
parent ec0ca7dcbc
commit 7b9ef96173
2 changed files with 197 additions and 40 deletions

View File

@@ -0,0 +1,5 @@
Subject: func_json
Additional parsing capabilities have been added to the
JSON_DECODE function, including support for arrays
and recursive indexing.