]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
rest-api-templates: Wikify error code response reasons 58/1458/1
authorMatt Jordan <mjordan@digium.com>
Wed, 21 Oct 2015 03:24:36 +0000 (22:24 -0500)
committerMatt Jordan <mjordan@digium.com>
Wed, 21 Oct 2015 03:24:36 +0000 (22:24 -0500)
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

rest-api-templates/api.wiki.mustache
rest-api-templates/asterisk_processor.py

index 73aa2448ad504567873f313db4ab13916662fc66..0a54a64a70c0159b093949c6316dec7a2d963676 100644 (file)
@@ -67,7 +67,7 @@ h3. Header parameters
 
 h3. Error Responses
 {{#error_responses}}
-* {{code}} - {{{reason}}}
+* {{code}} - {{{wiki_reason}}}
 {{/error_responses}}
 {{/has_error_responses}}
 {{/operations}}
index ab8a8afd28fdfd5ade7eb944ec95e346f1618fe2..68a6799946b63657cc743fff9674b4fcfdda1167 100644 (file)
@@ -199,6 +199,8 @@ class AsteriskProcessor(SwaggerPostProcessor):
             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):