[asterisk-commits] sgalarneau: trunk r417877 - in /trunk: ./ rest-api-templates/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jul 3 10:35:29 CDT 2014


Author: sgalarneau
Date: Thu Jul  3 10:35:22 2014
New Revision: 417877

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=417877
Log:
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

Modified:
    trunk/   (props changed)
    trunk/rest-api-templates/api.wiki.mustache
    trunk/rest-api-templates/swagger_model.py

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-12-merged' - no diff available.

Modified: trunk/rest-api-templates/api.wiki.mustache
URL: http://svnview.digium.com/svn/asterisk/trunk/rest-api-templates/api.wiki.mustache?view=diff&rev=417877&r1=417876&r2=417877
==============================================================================
--- trunk/rest-api-templates/api.wiki.mustache (original)
+++ trunk/rest-api-templates/api.wiki.mustache Thu Jul  3 10:35:22 2014
@@ -31,6 +31,16 @@
 {{/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

Modified: trunk/rest-api-templates/swagger_model.py
URL: http://svnview.digium.com/svn/asterisk/trunk/rest-api-templates/swagger_model.py?view=diff&rev=417877&r1=417876&r2=417877
==============================================================================
--- trunk/rest-api-templates/swagger_model.py (original)
+++ trunk/rest-api-templates/swagger_model.py Thu Jul  3 10:35:22 2014
@@ -402,6 +402,7 @@
         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')




More information about the asterisk-commits mailing list