asterisk/rest-api-templates
David M. Lee fccb427c88 ari:Add application/json parameter support
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.

(closes issue ASTERISK-22685)
Review: https://reviewboard.asterisk.org/r/2994/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403177 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-27 15:48:39 +00:00
..
README.txt This patch adds a RESTful HTTP interface to Asterisk. 2013-04-22 14:58:53 +00:00
api.wiki.mustache ari wiki docs: add notes about allowMultiple parameters. 2013-11-01 16:31:57 +00:00
ari.make.mustache ARI: Implement device state API 2013-11-23 17:48:28 +00:00
ari_model_validators.c.mustache The Swagger 1.2 specification for type extension ended up being 2013-10-24 20:48:17 +00:00
ari_model_validators.h.mustache ARI: Add subscription support 2013-10-04 16:01:48 +00:00
ari_resource.c.mustache ari: Fix #include to match generated headers for snakeCase resource files 2013-11-21 22:36:29 +00:00
ari_resource.h.mustache ari: User better nicknames for ARI operations 2013-11-07 21:10:31 +00:00
asterisk_processor.py ari:Add application/json parameter support 2013-11-27 15:48:39 +00:00
do-not-edit.mustache This patch adds a RESTful HTTP interface to Asterisk. 2013-04-22 14:58:53 +00:00
make_ari_stubs.py ari: Fix generators for resources with camelCase names. 2013-11-21 21:22:26 +00:00
models.wiki.mustache The Swagger 1.2 specification for type extension ended up being 2013-10-24 20:48:17 +00:00
odict.py This patch adds a RESTful HTTP interface to Asterisk. 2013-04-22 14:58:53 +00:00
param_cleanup.mustache ARI - implement allowMultiple for parameters 2013-08-02 14:36:32 +00:00
param_parsing.mustache ari:Add application/json parameter support 2013-11-27 15:48:39 +00:00
res_ari_resource.c.mustache ari:Add application/json parameter support 2013-11-27 15:48:39 +00:00
rest_handler.mustache ari: User better nicknames for ARI operations 2013-11-07 21:10:31 +00:00
swagger_model.py ari:Add application/json parameter support 2013-11-27 15:48:39 +00:00
transform.py Update events to use Swagger 1.3 subtyping, and related aftermath 2013-07-03 16:32:41 +00:00

README.txt

This directory contains templates and template processing code for generating
HTTP bindings for the RESTful API's.

The RESTful API's are declared using [Swagger][swagger]. While Swagger provides
a [code generating toolkit][swagger-codegen], it requires Java to run, which
would be an unusual dependency to require for Asterisk developers.

This code generator is similar, but written in Python. Templates are processed
by using [pystache][pystache], which is a fairly simply Python implementation of
[mustache][mustache].

 [swagger]: https://github.com/wordnik/swagger-core/wiki
 [swagger-codegen]: https://github.com/wordnik/swagger-codegen
 [pystache]: https://github.com/defunkt/pystache
 [mustache]: http://mustache.github.io/