summaryrefslogtreecommitdiff
path: root/rest-api-templates/swagger_model.py
diff options
context:
space:
mode:
authorKinsey Moore <kmoore@digium.com>2013-05-10 13:13:06 +0000
committerKinsey Moore <kmoore@digium.com>2013-05-10 13:13:06 +0000
commit7ce05bfb9b5f06c18451e37bb5b91cd543d6ba84 (patch)
treeb4e833909ec2ba776d39848ecf8d28f74b341424 /rest-api-templates/swagger_model.py
parent2cfedc12adf64cc24e855bd9ea30df3aa1b759ce (diff)
Add channel events for res_stasis apps
This change adds a framework in res_stasis for handling events from channel topics. JSON event generation and validation code is created from event documentation in rest-api/api-docs/events.json to assist in JSON event generation, ensure consistency, and ensure that accurate documentation is available for ALL events that are received by res_stasis applications. The userevent application has been refactored along with the code that handles userevent channel blob events to pass the headers as key/value pairs in the JSON blob. As a side-effect, app_userevent now handles duplicate keys by overwriting the previous value. Review: https://reviewboard.asterisk.org/r/2428/ (closes issue ASTERISK-21180) Patch-By: Kinsey Moore <kmoore@digium.com> git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388275 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'rest-api-templates/swagger_model.py')
-rw-r--r--rest-api-templates/swagger_model.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/rest-api-templates/swagger_model.py b/rest-api-templates/swagger_model.py
index 3e25cfdc2..c58a5f09b 100644
--- a/rest-api-templates/swagger_model.py
+++ b/rest-api-templates/swagger_model.py
@@ -295,13 +295,17 @@ class Model(Stringify):
def __init__(self):
self.id = None
+ self.notes = None
+ self.description = None
self.properties = None
def load(self, id, model_json, processor, context):
context = add_context(context, model_json, 'id')
+ # This arrangement is required by the Swagger API spec
self.id = model_json.get('id')
if id != self.id:
raise SwaggerError("Model id doesn't match name", c)
+ self.description = model_json.get('description')
props = model_json.get('properties').items() or []
self.properties = [
Property(k).load(j, processor, context) for (k, j) in props]