[Asterisk-code-review] func_json: Adds JSON_DECODE function (asterisk[master])

N A asteriskteam at digium.com
Thu Nov 18 11:50:19 CST 2021


Attention is currently required from: Joshua Colp, Kevin Harwell.
N A has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/16634 )

Change subject: func_json: Adds JSON_DECODE function
......................................................................


Patch Set 10:

(1 comment)

File funcs/func_json.c:

https://gerrit.asterisk.org/c/asterisk/+/16634/comment/175c1296_9e6c5354 
PS6, Line 109: 	result = ast_json_object_string_get(json, args.key);
> There is. […]
What I meant by public API is something in json.c/h that would fill a string buffer with the JSON value, regardless of whether the actual JSON value is a string, integer, array, etc. e.g. it would case on the enum type and do that as opposed to individual modules having to do that, which feels clunky to me. But maybe there's a way it's set up like that. I see the get_integer was only added 28 days ago, I was wondering why it wasn't compiling on 18.8.1 and then I saw that it hadn't existed then...

The other problem with recursing is that keys could be identically named, e.g. parent->something->key, parent->somethingelse->key, which I see quite often in JSON output. So then we would also need to parse a hierarchical key into its components and that might end up being more trouble than it's worth here, when most JSON people will parse is probably just 1 or 2 levels.



-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/16634
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: Iea60c49a7358dfdc2db60803cdc9a742f808ba2c
Gerrit-Change-Number: 16634
Gerrit-PatchSet: 10
Gerrit-Owner: N A <mail at interlinked.x10host.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Attention: Joshua Colp <jcolp at sangoma.com>
Gerrit-Attention: Kevin Harwell <kharwell at digium.com>
Gerrit-Comment-Date: Thu, 18 Nov 2021 17:50:19 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: N A <mail at interlinked.x10host.com>
Comment-In-Reply-To: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20211118/39e86f3b/attachment-0001.html>


More information about the asterisk-code-review mailing list