Change vfc-catalog swagger url directory 39/42639/1
authorying.yunlong <ying.yunlong@zte.com.cn>
Fri, 13 Apr 2018 02:33:37 +0000 (10:33 +0800)
committerying.yunlong <ying.yunlong@zte.com.cn>
Fri, 13 Apr 2018 02:33:37 +0000 (10:33 +0800)
Change-Id: I2006b5132044be04ece5c9422db8bdff0ae868ae
Issue-ID: VFC-877
Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
catalog/settings.py
catalog/swagger/urls.py
catalog/urls.py

index ff19ff2..30b7db0 100644 (file)
@@ -50,7 +50,6 @@ INSTALLED_APPS = [
     'catalog.pub.database',
     'catalog.samples',
     'catalog.swagger',
-
     'drf_yasg',
 ]
 
@@ -58,8 +57,7 @@ INSTALLED_APPS = [
 SWAGGER_SETTINGS = {
     'LOGIN_URL': '/admin/login',
     'LOGOUT_URL': '/admin/logout',
-
-    'DEFAULT_INFO': 'catalog.urls.swagger_info'
+    'DEFAULT_INFO': 'catalog.swagger.urls.swagger_info'
 }
 
 TEMPLATES = [
@@ -102,8 +100,6 @@ REST_FRAMEWORK = {
     'DEFAULT_PARSER_CLASSES': (
         'rest_framework.parsers.JSONParser',
         'rest_framework.parsers.MultiPartParser',
-        # 'rest_framework.parsers.FormParser',
-        # 'rest_framework.parsers.FileUploadParser',
     )
 }
 
index b5e91f0..146cb04 100644 (file)
 # limitations under the License.
 
 from django.conf.urls import url
+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)."""
+)
+
+SchemaView = get_schema_view(
+    validators=['ssv', 'flex'],
+    public=True,
+    permission_classes=(permissions.AllowAny,),
+)
+
 urlpatterns = [
-    url(r'^api/catalog/v1/swagger.json$', SwaggerJsonView.as_view())
+    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'),
 ]
index 291e9f9..6b4abf1 100644 (file)
 # limitations under the License.
 
 from django.conf.urls import include, url
-from catalog.pub.config.config import REG_TO_MSB_WHEN_START, REG_TO_MSB_REG_URL, REG_TO_MSB_REG_PARAM
-from rest_framework import permissions
-
-from drf_yasg import openapi
-from drf_yasg.views import get_schema_view
-
-
-# Add code for generating swagger automatically.
-swagger_info = openapi.Info(
-    title="Snippets API",
-    default_version='v1',
-    description="""This is a VFC project for the catalog."""
-)
-
-SchemaView = get_schema_view(
-    validators=['ssv', 'flex'],
-    public=True,
-    permission_classes=(permissions.AllowAny,),
-)
 
+from catalog.pub.config.config import REG_TO_MSB_WHEN_START, REG_TO_MSB_REG_URL, REG_TO_MSB_REG_PARAM
 
 urlpatterns = [
-
-    # Add code for generating swagger automatically.
-    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'^cached/swagger(?P<format>.json|.yaml)$',
-        SchemaView.without_ui(cache_timeout=None), name='cschema-json'),
-    url(r'^cached/swagger/$', SchemaView.with_ui('swagger',
-                                                 cache_timeout=None), name='cschema-swagger-ui'),
-    url(r'^cached/redoc/$', SchemaView.with_ui('redoc',
-                                               cache_timeout=None), name='cschema-redoc'),
     url(r'^', include('catalog.samples.urls')),
     url(r'^', include('catalog.packages.urls')),
     url(r'^', include('catalog.jobs.urls')),