[asterisk-commits] mjordan: branch 12 r407389 - /branches/12/rest-api-templates/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Feb 4 18:08:54 CST 2014
Author: mjordan
Date: Tue Feb 4 18:08:50 2014
New Revision: 407389
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=407389
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.
Modified:
branches/12/rest-api-templates/api.wiki.mustache
branches/12/rest-api-templates/swagger_model.py
Modified: branches/12/rest-api-templates/api.wiki.mustache
URL: http://svnview.digium.com/svn/asterisk/branches/12/rest-api-templates/api.wiki.mustache?view=diff&rev=407389&r1=407388&r2=407389
==============================================================================
--- branches/12/rest-api-templates/api.wiki.mustache (original)
+++ branches/12/rest-api-templates/api.wiki.mustache Tue Feb 4 18:08:50 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: branches/12/rest-api-templates/swagger_model.py
URL: http://svnview.digium.com/svn/asterisk/branches/12/rest-api-templates/swagger_model.py?view=diff&rev=407389&r1=407388&r2=407389
==============================================================================
--- branches/12/rest-api-templates/swagger_model.py (original)
+++ branches/12/rest-api-templates/swagger_model.py Tue Feb 4 18:08:50 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