Account for {} in Swagger notes
authorDavid M. Lee <dlee@digium.com>
Thu, 29 Aug 2013 16:21:31 +0000 (16:21 +0000)
committerDavid M. Lee <dlee@digium.com>
Thu, 29 Aug 2013 16:21:31 +0000 (16:21 +0000)
........

Merged revisions 397927 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397932 65c4cc65-6c06-0410-ace0-fbb531ad65f3

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

index c70e58f..a19e496 100644 (file)
@@ -13,7 +13,7 @@ h1. {{name_title}}
 {anchor:{{nickname}}}
 h2. {{http_method}} {{wiki_path}}
 
-{{{summary}}}{{#notes}} {{{notes}}}{{/notes}}
+{{{summary}}}{{#wiki_notes}} {{{wiki_notes}}}{{/wiki_notes}}
 {{#has_path_parameters}}
 
 h3. Path parameters
index 6f69b48..65013d3 100644 (file)
@@ -187,6 +187,7 @@ class AsteriskProcessor(SwaggerPostProcessor):
         operation.c_http_method = 'AST_HTTP_' + operation.http_method
         if not operation.summary.endswith("."):
             raise SwaggerError("Summary should end with .", context)
+        operation.wiki_notes = wikify(operation.notes or "")
 
     def process_parameter(self, parameter, context):
         if not parameter.data_type in self.type_mapping:
index 8058862..a08b9bf 100755 (executable)
 # at the top of the source tree.
 #
 
+import sys
+
 try:
     import pystache
 except ImportError:
     print >> sys.stderr, "Pystache required. Please sudo pip install pystache."
+    sys.exit(1)
 
 import os.path
-import sys
 
 from asterisk_processor import AsteriskProcessor
 from optparse import OptionParser