[asterisk-commits] rest-api-templates: Wikify error code response reasons (asterisk[13])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Oct 21 16:44:23 CDT 2015


Joshua Colp has submitted this change and it was merged.

Change subject: rest-api-templates: Wikify error code response reasons
......................................................................


rest-api-templates: Wikify error code response reasons

Error response code descriptions may contain wiki markup that need to be
escaped. Without this patch, Confluence will reject the document being sent
and the responsible script will raise an exception.

Change-Id: I21fcb66fee7f6332381f2b99b1b0195dff215ee5
---
M rest-api-templates/api.wiki.mustache
M rest-api-templates/asterisk_processor.py
2 files changed, 3 insertions(+), 1 deletion(-)

Approvals:
  Kevin Harwell: Looks good to me, but someone else must approve
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, approved



diff --git a/rest-api-templates/api.wiki.mustache b/rest-api-templates/api.wiki.mustache
index 73aa244..0a54a64 100644
--- a/rest-api-templates/api.wiki.mustache
+++ b/rest-api-templates/api.wiki.mustache
@@ -67,7 +67,7 @@
 
 h3. Error Responses
 {{#error_responses}}
-* {{code}} - {{{reason}}}
+* {{code}} - {{{wiki_reason}}}
 {{/error_responses}}
 {{/has_error_responses}}
 {{/operations}}
diff --git a/rest-api-templates/asterisk_processor.py b/rest-api-templates/asterisk_processor.py
index ab8a8af..68a6799 100644
--- a/rest-api-templates/asterisk_processor.py
+++ b/rest-api-templates/asterisk_processor.py
@@ -199,6 +199,8 @@
             raise SwaggerError("Summary should end with .", context)
         operation.wiki_summary = wikify(operation.summary or "")
         operation.wiki_notes = wikify(operation.notes or "")
+        for error_response in operation.error_responses:
+            error_response.wiki_reason = wikify(error_response.reason or "")
         operation.parse_body = (operation.body_parameter or operation.has_query_parameters) and True
 
     def process_parameter(self, parameter, context):

-- 
To view, visit https://gerrit.asterisk.org/1458
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I21fcb66fee7f6332381f2b99b1b0195dff215ee5
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>



More information about the asterisk-commits mailing list