diff options
author | 2017-05-11 10:26:35 +0000 | |
---|---|---|
committer | 2017-05-11 10:26:35 +0000 | |
commit | 858fada30fc828dc0caaae3b13eea4b8c445fadb (patch) | |
tree | 9389e3ed1e2e84b2f3bf5701fe18daacf3cb6c01 /utils | |
parent | aea9ab231aa285269d2577d847385f721a12d6cd (diff) | |
parent | 942e19eca5228602a2ee73b0d4ef12d2e04ee6f1 (diff) |
Merge "change swagger urls based on v1.2 specification"
Diffstat (limited to 'utils')
3 files changed, 11 insertions, 10 deletions
diff --git a/utils/test/testapi/opnfv_testapi/tornado_swagger/handlers.py b/utils/test/testapi/opnfv_testapi/tornado_swagger/handlers.py index 2154b4697..af0b515ad 100644 --- a/utils/test/testapi/opnfv_testapi/tornado_swagger/handlers.py +++ b/utils/test/testapi/opnfv_testapi/tornado_swagger/handlers.py @@ -9,7 +9,7 @@ from tornado.web import URLSpec, StaticFileHandler from settings import default_settings, \ - SWAGGER_API_DOCS, SWAGGER_API_LIST, SWAGGER_API_SPEC + SWAGGER_API_DOCS, SWAGGER_RESOURCE_LISTING, SWAGGER_API_DECLARATION from views import SwaggerUIHandler, SwaggerResourcesHandler, SwaggerApiHandler @@ -27,15 +27,15 @@ def swagger_handlers(): default_settings, name=SWAGGER_API_DOCS), URLSpec( - _path(r'spec.json$'), + _path(r'resources.json$'), SwaggerResourcesHandler, default_settings, - name=SWAGGER_API_LIST), + name=SWAGGER_RESOURCE_LISTING), URLSpec( - _path(r'spec$'), + _path(r'APIs$'), SwaggerApiHandler, default_settings, - name=SWAGGER_API_SPEC), + name=SWAGGER_API_DECLARATION), ( _path(r'(.*\.(css|png|gif|js))'), StaticFileHandler, diff --git a/utils/test/testapi/opnfv_testapi/tornado_swagger/settings.py b/utils/test/testapi/opnfv_testapi/tornado_swagger/settings.py index 88d0d0f88..753029709 100644 --- a/utils/test/testapi/opnfv_testapi/tornado_swagger/settings.py +++ b/utils/test/testapi/opnfv_testapi/tornado_swagger/settings.py @@ -10,8 +10,8 @@ import os.path SWAGGER_VERSION = '1.2' SWAGGER_API_DOCS = 'swagger-api-docs' -SWAGGER_API_LIST = 'swagger-api-list' -SWAGGER_API_SPEC = 'swagger-api-spec' +SWAGGER_RESOURCE_LISTING = 'swagger-resource-listing' +SWAGGER_API_DECLARATION = 'swagger-api-declaration' STATIC_PATH = os.path.join(os.path.dirname(os.path.normpath(__file__)), 'static') diff --git a/utils/test/testapi/opnfv_testapi/tornado_swagger/views.py b/utils/test/testapi/opnfv_testapi/tornado_swagger/views.py index 25083195b..2168c5e91 100644 --- a/utils/test/testapi/opnfv_testapi/tornado_swagger/views.py +++ b/utils/test/testapi/opnfv_testapi/tornado_swagger/views.py @@ -12,7 +12,8 @@ import json import tornado.template import tornado.web -from settings import SWAGGER_VERSION, SWAGGER_API_LIST, SWAGGER_API_SPEC +from settings import SWAGGER_VERSION +from settings import SWAGGER_RESOURCE_LISTING, SWAGGER_API_DECLARATION from settings import models, basePath @@ -29,7 +30,7 @@ class SwaggerUIHandler(tornado.web.RequestHandler): return self.static_path def get(self): - discovery_url = basePath() + self.reverse_url(SWAGGER_API_LIST) + discovery_url = basePath() + self.reverse_url(SWAGGER_RESOURCE_LISTING) self.render('index.html', discovery_url=discovery_url) @@ -47,7 +48,7 @@ class SwaggerResourcesHandler(tornado.web.RequestHandler): 'produces': ["application/json"], 'description': 'Test Api Spec', 'apis': [{ - 'path': self.reverse_url(SWAGGER_API_SPEC), + 'path': self.reverse_url(SWAGGER_API_DECLARATION), 'description': 'Test Api Spec' }] } |