[asterisk-commits] dlee: branch dlee/better-nicknames r401260 - /team/dlee/better-nicknames/rest...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Oct 18 15:55:57 CDT 2013


Author: dlee
Date: Fri Oct 18 15:55:55 2013
New Revision: 401260

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=401260
Log:
Error if API's have duplicate paths

Modified:
    team/dlee/better-nicknames/rest-api-templates/swagger_model.py

Modified: team/dlee/better-nicknames/rest-api-templates/swagger_model.py
URL: http://svnview.digium.com/svn/asterisk/team/dlee/better-nicknames/rest-api-templates/swagger_model.py?view=diff&rev=401260&r1=401259&r2=401260
==============================================================================
--- team/dlee/better-nicknames/rest-api-templates/swagger_model.py (original)
+++ team/dlee/better-nicknames/rest-api-templates/swagger_model.py Fri Oct 18 15:55:55 2013
@@ -632,6 +632,11 @@
         api_json = api_decl_json.get('apis') or []
         self.apis = [
             Api().load(j, processor, context) for j in api_json]
+        paths = set()
+        for api in self.apis:
+            if api.path in paths:
+                raise SwaggerError("API with duplicated path: %s" % api.path, context)
+            paths.add(api.path)
         self.has_websocket = filter(lambda api: api.has_websocket,
                                     self.apis) == []
         models = api_decl_json.get('models').items() or []




More information about the asterisk-commits mailing list