[Asterisk-code-review] func_json: Adds JSON_DECODE function (asterisk[master])
Kevin Harwell
asteriskteam at digium.com
Thu Nov 18 11:59:41 CST 2021
Attention is currently required from: N A, Joshua Colp.
Kevin Harwell 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/f86b9c46_e47f0458
PS6, Line 109: result = ast_json_object_string_get(json, args.key);
> What I meant by public API is something in json. […]
Ah yeah I agree. I would not be opposed to adding something like that to our json api. Maybe an 'ast_json_object_get_as_string'.
Or perhaps better an 'ast_json_to_string' that attempts to convert a given object to a string (obviously failing where it can't). Then you could have a macro 'ast_json_object_get_as_string(obj, key) which that simply combines the object_get and to_string calls.
If you do decide to add this to the API I would suggest also adding a unit test for it in test_json.c
--
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: N A <mail at interlinked.x10host.com>
Gerrit-Attention: Joshua Colp <jcolp at sangoma.com>
Gerrit-Comment-Date: Thu, 18 Nov 2021 17:59:41 +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/c2317268/attachment.html>
More information about the asterisk-code-review
mailing list