This feature is great and it works well for root level JSON objects. However, is there a way to pluck a property multiple levels deep?
Also, is there a way to parse array’s? I didn’t see anything in the tests that would indicate this ability. I also tried a few variations as shown in the older res_json module but didn’t work.
Ah, I see what you mean. Yeah, you can’t do this with the module currently unfortunately.
I can keep this in mind, but at the moment this is not on my list of things to look into and I’m somewhat backlogged. If you need these for your business and you’re able to place a feature bounty of this, I can expedite adding some or all of this functionality this month. Otherwise, it may have to wait until I or someone else in the community has the time and interest in adding this. I don’t know what the timeframe on that would be.
As far as JSON_ENCODE, I am not sure if I understand the use case, JSON_DECODE I imagine as typically being used in conjunction with someone like CURL or SHELL to parse API responses, but if there was a reasonable use case for encoding JSON then I suppose that might make some sense too.
Also, to elaborate on an earlier point, a problem I see with JSON_ENCODE is that with decoding, you’re taking a JSON string and parsing out an element from a logical array, whereas with encoding, you’re doing the reverse. The dialplan doesn’t have any concept of an “array”, so I’m not sure what it would even make sense to encode here.
If you already have an idea about this Mark, I’d be curious to hear.