summaryrefslogtreecommitdiff
path: root/rest-api-templates/swagger_model.py
diff options
context:
space:
mode:
Diffstat (limited to 'rest-api-templates/swagger_model.py')
-rw-r--r--rest-api-templates/swagger_model.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/rest-api-templates/swagger_model.py b/rest-api-templates/swagger_model.py
index be98c4a3c..144f22bdb 100644
--- a/rest-api-templates/swagger_model.py
+++ b/rest-api-templates/swagger_model.py
@@ -631,6 +631,11 @@ class ApiDeclaration(Stringify):
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 []