[asterisk-dev] [Code Review] 2994: ari:Add application/json parameter support

Matt Jordan reviewboard at asterisk.org
Wed Nov 20 18:07:57 CST 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2994/#review10223
-----------------------------------------------------------



/branches/12/main/http.c
<https://reviewboard.asterisk.org/r/2994/#comment19559>

    Particularly since this is coming from an external source, we should probably use sscanf.
    
    You pretty much do all of your checking for this already in ast_http_get_json, so it might be a moot point, but hey - coding guidelines :-)



/branches/12/res/res_ari_applications.c
<https://reviewboard.asterisk.org/r/2994/#comment19560>

    Why wouldn't we need to free args.event_source here as well? Could it not have been allocated previously on line 219 as well?



/branches/12/res/res_ari_applications.c
<https://reviewboard.asterisk.org/r/2994/#comment19561>

    Same finding here.


- Matt Jordan


On Nov. 15, 2013, 6:29 p.m., David Lee wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2994/
> -----------------------------------------------------------
> 
> (Updated Nov. 15, 2013, 6:29 p.m.)
> 
> 
> Review request for Asterisk Developers and Paul Belanger.
> 
> 
> Bugs: ASTERISK-22685
>     https://issues.asterisk.org/jira/browse/ASTERISK-22685
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> The patch allows ARI to parse request parameters from an incoming JSON
> request body, instead of requiring the request to come in as query
> parameters (which is just weird for POST and DELETE) or form
> parameters (which is okay, but a bit asymmetric given that all of our
> responses are JSON).
> 
> For any operation that does _not_ have a parameter defined of type
> body (i.e. "paramType": "body" in the API declaration), if a request
> provides a request body with a Content type of "application/json", the
> provided JSON document is parsed and searched for parameters.
> 
> The expected fields in the provided JSON document should match the
> query parameters defined for the operation. If the parameter has
> 'allowMultiple' set, then the field in the JSON document may
> optionally be an array of values.
> 
> 
> Diffs
> -----
> 
>   /branches/12/tests/test_ari.c 402455 
>   /branches/12/rest-api-templates/swagger_model.py 402455 
>   /branches/12/rest-api-templates/res_ari_resource.c.mustache 402455 
>   /branches/12/rest-api-templates/param_parsing.mustache 402455 
>   /branches/12/rest-api-templates/asterisk_processor.py 402455 
>   /branches/12/res/res_ari_sounds.c 402455 
>   /branches/12/res/res_ari_recordings.c 402455 
>   /branches/12/res/res_ari_playback.c 402455 
>   /branches/12/res/res_ari_endpoints.c 402455 
>   /branches/12/res/res_ari_channels.c 402455 
>   /branches/12/res/res_ari_bridges.c 402455 
>   /branches/12/res/res_ari_asterisk.c 402455 
>   /branches/12/res/res_ari_applications.c 402455 
>   /branches/12/res/res_ari.c 402455 
>   /branches/12/main/http.c 402455 
>   /branches/12/include/asterisk/http.h 402455 
>   /branches/12/include/asterisk/ari.h 402455 
> 
> Diff: https://reviewboard.asterisk.org/r/2994/diff/
> 
> 
> Testing
> -------
> 
> Testsuite test.
> 
> See https://reviewboard.asterisk.org/r/2993/
> 
> 
> Thanks,
> 
> David Lee
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20131121/3d2493d4/attachment.html>


More information about the asterisk-dev mailing list