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

David Lee reviewboard at asterisk.org
Fri Nov 15 09:28:31 CST 2013



> On Nov. 14, 2013, 9:41 a.m., opticron wrote:
> > /branches/12/main/http.c, line 625
> > <https://reviewboard.asterisk.org/r/2994/diff/1/?file=47957#file47957line625>
> >
> >     Is there a MIME type that could be explicitly used to pass form data instead of omitting the header?

This is parsing when Content-type is application/json. I blame this on
copy/paste laziness on my part. I'll clean that up.


> On Nov. 14, 2013, 9:41 a.m., opticron wrote:
> > /branches/12/rest-api-templates/res_ari_resource.c.mustache, lines 105-106
> > <https://reviewboard.asterisk.org/r/2994/diff/1/?file=47969#file47969line105>
> >
> >     This should get 400 and 413 added to it since they are new errors generated by stub code.

Those errors skip these validations, so they're not needed here.


- David


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


On Nov. 4, 2013, 3:27 p.m., David Lee wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2994/
> -----------------------------------------------------------
> 
> (Updated Nov. 4, 2013, 3:27 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/20131115/8c80c30e/attachment.html>


More information about the asterisk-dev mailing list