Fix vfc-catalog auto swagger url 41/42641/2
authorying.yunlong <ying.yunlong@zte.com.cn>
Fri, 13 Apr 2018 02:37:30 +0000 (10:37 +0800)
committerying.yunlong <ying.yunlong@zte.com.cn>
Fri, 13 Apr 2018 02:45:50 +0000 (10:45 +0800)
Change-Id: I44bd754174b68e479bb5170a8beb1c4c21d70c12
Issue-ID: VFC-877
Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
catalog/swagger/urls.py

index 146cb04..5437ee5 100644 (file)
@@ -17,18 +17,16 @@ from drf_yasg import openapi
 from drf_yasg.views import get_schema_view
 from rest_framework import permissions
 
-from catalog.swagger.views import SwaggerJsonView
-
 # Add code for generating swagger automatically.
 swagger_info = openapi.Info(
     title="VFC Catalog API",
     default_version='v1',
     description="""
 
-The `swagger-ui` view can be found [here](/api/vnflcm/v1/swagger).
-The `ReDoc` view can be found [here](/api/vnflcm/v1/redoc).
-The swagger YAML document can be found [here](/api/vnflcm/v1/swagger.yaml).
-The swagger JSON document can be found [here](/api/vnflcm/v1/swagger.json)."""
+The `swagger-ui` view can be found [here](/api/catalog/v1/swagger).
+The `ReDoc` view can be found [here](/api/catalog/v1/redoc).
+The swagger YAML document can be found [here](/api/catalog/v1/swagger.yaml).
+The swagger JSON document can be found [here](/api/catalog/v1/swagger.json)."""
 )
 
 SchemaView = get_schema_view(
@@ -38,8 +36,8 @@ SchemaView = get_schema_view(
 )
 
 urlpatterns = [
-    url(r'^api/catalog/v1/swagger.json$', SwaggerJsonView.as_view()),
-    url(r'^swagger(?P<format>.json|.yaml)$', SchemaView.without_ui(cache_timeout=0), name='schema-json'),
-    url(r'^swagger/$', SchemaView.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'),
-    url(r'^redoc/$', SchemaView.with_ui('redoc', cache_timeout=0), name='schema-redoc'),
+    url(r'^api/catalog/v1/swagger.json$', SwaggerJsonView.as_view()),
+    url(r'^api/catalog/v1/swagger(?P<format>.json|.yaml)$', SchemaView.without_ui(cache_timeout=0), name='schema-json'),
+    url(r'^api/catalog/v1/swagger$', SchemaView.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'),
+    url(r'^api/catalog/v1/redoc$', SchemaView.with_ui('redoc', cache_timeout=0), name='schema-redoc'),
 ]