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

David Lee reviewboard at asterisk.org
Thu Nov 21 14:47:38 CST 2013


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

(Updated Nov. 21, 2013, 2:47 p.m.)


Review request for Asterisk Developers and Paul Belanger.


Changes
-------

Properly handle allocations when both query params and JSON body params are offered.


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 (updated)
-----

  /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/754636bb/attachment.html>


More information about the asterisk-dev mailing list