From: Sam Galarneau Date: Thu, 3 Jul 2014 15:35:22 +0000 (+0000) Subject: api.wiki.mustache: Update wiki template to support body parameters X-Git-Tag: 13.0.0-beta1~152 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5db3f38d5a8d49e4d07e6342b4557092496d28de;p=thirdparty%2Fasterisk.git api.wiki.mustache: Update wiki template to support body parameters This patch updates the api.wiki.mustache template and the swagger_model python script to understand if an operation has a body parameter. If an operation does have a body parameter, it will now be displayed in the corresponding wiki entry. ........ Merged revisions 407389 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417877 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/rest-api-templates/api.wiki.mustache b/rest-api-templates/api.wiki.mustache index 322bb58df0..de6de2dcc4 100644 --- a/rest-api-templates/api.wiki.mustache +++ b/rest-api-templates/api.wiki.mustache @@ -31,6 +31,16 @@ h3. Query parameters {{/allow_multiple}} {{/query_parameters}} {{/has_query_parameters}} +{{#has_body_parameter}} + +h3. Body parameter +{{#body_parameter}} +* {{name}}: {{data_type}}{{#default_value}} = {{default_value}}{{/default_value}} -{{#required}} *(required)*{{/required}} {{{wiki_description}}} +{{#allow_multiple}} +** Allows comma separated values. +{{/allow_multiple}} +{{/body_parameter}} +{{/has_body_parameter}} {{#has_header_parameters}} h3. Header parameters diff --git a/rest-api-templates/swagger_model.py b/rest-api-templates/swagger_model.py index 01659d1452..9c65219e57 100644 --- a/rest-api-templates/swagger_model.py +++ b/rest-api-templates/swagger_model.py @@ -402,6 +402,7 @@ class Operation(Stringify): if len(self.body_parameter) > 1: raise SwaggerError("Cannot have more than one body param", context) self.body_parameter = self.body_parameter and self.body_parameter[0] + self.has_body_parameter = self.body_parameter and True self.summary = op_json.get('summary') self.notes = op_json.get('notes')